o3djs.require('o3djs.util');
o3djs.require('o3djs.math');
o3djs.require('o3djs.rendergraph');
o3djs.require('o3djs.material');
o3djs.require('o3djs.picking');
o3djs.require('o3djs.pack');
o3djs.require('o3djs.debug');
o3djs.require('o3djs.loader');
o3djs.require('o3djs.primitives');


var PI = Math.PI;


var model_id;

var e0;
var e1;
var e2;
var e3;
var e4;
var e5;

var e6;
var e7;
var e8;

var e9 = new Array;
var e10 = new Array;
var e46 = new Array;
var e47 = new Array;
var e48 = new Array;

var e49 = new Array;


var e50 = [3*PI/4,PI/4,40,0,0,0];

var e51 = new Array;

var e52 = new Array;

var e53;

var e54 = new Array;

var e55;

var undoNumber = new Array;
var e56 = 1.7;
var e57 = 0.005;
var factor = 0;
var factorSin;

var e11;
var e12;
var e13 = new Array;
var e14 = new Array;

var e58 = new Array;
var e59 = true;
var e15 = "DEFAULT";
var e16 = "DEFAULT";
var mouseCursorStatus; 


var e17; 


var e18 = false;

var e60 = e60||{};
	e60.red = 1;
	e60.green = 1;
	e60.blue = 1;
	e60.alpha = 1;
	
	e60.x = 0;
	e60.y = 0;
	e60.z = 0;
	

var e61 = new Array; 



var cubeFinished = false;
var e62 = new Array ;
var e63 = new Array;
var e64 = new Array;
	e64.e19 = new Array;
var e65 = new Array;
var e66;
var e67;
var e68 = new Array;

var e69;
var e70;

var e71 = new Array; 
var e72 = new Array;
var e73 = new Array;
var e74;
	
var e76;
var e75;
var e20 = 3000;
var materialUrls = [
	'ishader/texture-colormult.shader'
	];
var textures = new Array;
var textureUrls = [
					"ipic/menu_blank.png",
					"ipic/menu_c.png",
					"ipic/menu_colorPen.png",
					"ipic/menu_ctrl_a.png",
					"ipic/menu_ctrl_g.png",
					"ipic/menu_ctrl_s.png",
					"ipic/menu_ctrl_z.png",
					"ipic/menu_del.png",
					"ipic/menu_down.png",
					"ipic/menu_e.png",
					"ipic/menu_esc.png",
					"ipic/menu_g.png",
					"ipic/menu_i.png",
					"ipic/menu_left.png",
					"ipic/menu_m.png",
					"ipic/menu_r.png",
					"ipic/menu_review.png",
					"ipic/menu_right.png",
					"ipic/menu_up.png",
					"ipic/menu_f.png",
					"ipic/colorLine_cursor.png",
					"ipic/colorTBg.png",
					
					"ipic/colorLibrary.png",
					"ipic/comparisonBg.png",
					"ipic/switchButton.png",
					"ipic/switchButtonOn.png",
					"ipic/changeButton.png",				
					"ipic/changeButtonOn.png",
					"ipic/emptyButton.png",	
					"ipic/emptyButtonOn.png",
					"ipic/customizeButton.png",	
					"ipic/customizeButtonOn.png",
					"ipic/joinButton.png",	
					"ipic/joinButtonOn.png",
					"ipic/deleteButton.png",	
					"ipic/deleteButtonOn.png",
					"ipic/dropperButton.png",	
					"ipic/dropperButtonOn.png",
					"ipic/setColor_cover.png",
					"ipic/setColor_title.png",
					"ipic/setColor_rgb_cursor.png",
					"ipic/setColor_pure_cursor.png",
					"ipic/setColor_line_cursor.png",
					"ipic/button_white.png",
					"ipic/button_red.png",
					"ipic/button_blue.png",
					"ipic/tips_bg.png",
					"ipic/button_closeX_red.png",
					"ipic/button_closeX_white.png",
					"ipic/button_ok_blue.png",
					"ipic/button_ok_white.png",
					
					"ipic/librarySelect_bg.png",
					"ipic/librarySelect_colorBg.png",
					"ipic/librarySelect_colorFrame.png",
					"ipic/librarySelect_cursor.png",
					"ipic/librarySelect_del_red.png",
					"ipic/librarySelect_del_white.png",
					
					"ipic/librarySelect_left_blue.png",
					"ipic/librarySelect_left_gray.png",
					"ipic/librarySelect_right_blue.png",
					"ipic/librarySelect_right_gray.png",
					
					"ipic/librarySelect_leftCover.png",
					"ipic/librarySelect_rightCover.png",
					
					"ipic/colorMark.png",
					
					"ipic/brush.png"
					
					];

window.onunload = uninit;

function init(){
	o3djs.util.makeClients(e21);
	}
	
function uninit() {
    if (e1) {
   		e1.cleanup();
  		}
	}

function e21(clientElements){
	e0 = clientElements[0];
	e1 = e0.client;
	e3 = e0.o3d;
	e5 = o3djs.math;
	e4 = e1.createPack(); 
	
	e9.transform = e4.createObject("Transform");
	e9.transform.parent = e1.root;
	
	e9.x = 0;
	e9.y = 0;
	e9.z = 0;
	e9.localX = 0;
	e9.localY = 0;
	e9.localZ = 0;
	e62.push(e9);
	
	e10.transform = e4.createObject("Transform");
	e10.transform.parent = e1.root;
	e47.transform = e4.createObject("Transform");
	e47.transform.parent = e1.root;

	initEye();
	initViewInfo();	
	e22();
	
	e48[2] = new e220.e218();
	e48[1] = new e220.e217(1,1,1,1);
	e48[0] = new e220.e222();
	e48[4] = new e220.e217(0,0,0,1);
	
	e66 = new e220.e263(1,0.2,0.2,1);
	e67 = new e220.e67(1,0.2,0.2,1);
	

	e58["alphaTime"] = true;
	flashFramesIf();
	}
	
function e22(){
	var loader = o3djs.loader.createLoader(e23);
	var textureLinkName;
	for(var n=0;n < textureUrls.length;n++){
		textureLinkName = textureUrls[n];
		textureLinkName = cutUrlToSingle(textureLinkName);
		textures[textureLinkName] = textureUrls[n];
		loadTexture(loader,textureLinkName);
		}
	loader.finish();
	}

function loadTexture(loader,urlObj){
	loader.loadTexture(e4, textures[urlObj], function(texture, exception) {
					   if (exception) {
					   alert(exception);
					   }
					   else {
					   textures[urlObj] = texture;}});
	}
	

function e23(){
	
	e104.init();
	
	var defultCreator = new e132.basicCreator();
	e132.setColor = e132.e166(defultCreator,[e60.red,
															e60.green,
															e60.blue,
															e60.alpha]);
	e132.setColor.e139([0]);
	e132.tips = e132.create_ATips(defultCreator,"这是什么？",800);
	
	e132.setColor.changeZ([-1000]);
	
	e96.init();
	
	e220.e206();
	
	initEvent();
	
	e132.tips.showBy("欢迎来到自由方块世界！初次使用，场景中间已经预先创建了一个原始的方块,你需要它来逐渐创建出你自己的方块造型。先点击它试试^_^。",500);
	cubeFinished = true;
	if(model_id){
		loadModel(model_id);
		}
	
	
	
	}
	
	
function cutUrlToSingle(url){
	var subNum = url.indexOf("/");
	var subUrl = url.slice(subNum + 1);
	subNum = subUrl.indexOf("/");
	if(subNum == -1){
		subNum = subUrl.indexOf(".");
		subUrl = subUrl.slice(0,subNum);
		return  subUrl;
		}
		else{
			return cutUrlToSingle(subUrl);
			}
	
	}	


function flashFramesIf(){
	var flashCheck = setInterval(function(){flashFrames()},50);
	var reCheckAlpha = setInterval(function(){e224()},50);
	}
	
function flashFrames(){
	factor +=0.2;
	if(e58["alphaTime"]){
		factorSin = (Math.cos(factor)+1)/2;
		}
		else{
			factorSin = 0.5;
			}
	}
	
function e224(){
	if (e63[0]){
		if(e66.visible){
			e66.arrowTransform_0_Move.identity();
			e66.arrowTransform_0_Move.translate(0,(Math.cos(factor)+1)/10,0);
			e66.arrowTransform_1_Move.identity();
			e66.arrowTransform_1_Move.translate(0,(Math.cos(factor)+1)/10,0);
			}
		else if(e67.visible){
			e67.transform_0.identity();
			e67.transform_0.translate(0,(Math.cos(factor)+1)/7,0);
			if(factorSin>0.8){
				e67.displayCube();
				}
			else{
				e67.clearCube();
				}
			}
		for(var n=0;n < e63.length;n++){
			if(e63[n][2][0]){
				e225(e63[n][2]);
				}
				else{
					 if(!e63[n][2].wireFrame){
						e220.e213(e48[1].frameShape,e48[2].planShape,
														1,1,1,1,
														e63[n][2],
														e63[n][3],
														1);
					 }
					 else{
						 for(var nDir=0;nDir < 6;nDir++){
							 if(e63[n][3][nDir]){
						 e63[n][2].wireFrame.transformPlanArray[nDir].getParam("diffuse").value = [
															 1,
															 1,
															 1,
															 factorSin*e63[n][2].alpha
															 ];
								 }
							 }
						}
					}
			}
			}
	}
	
function e225(e87){
	for(var n=0;n < e87.length;n++){
		if(e87[n][0]){
			e225(e87[n]);
			}
			else{
				 if(!e87[n].wireFrame){
					e220.e213(e48[4].frameShape,e48[2].planShape,
													1,1,1,1,
													e87[n],
													[],
													1);
					 }
				
			}		
		}
	}

function initEye(){
	e52[0] = e50[0];
	e52[1] = e50[1];
	e53 = e50[2];
	e54[0] = e50[3];
	e54[1] = e50[4];
	e54[2] = e50[5];
	e51[2] = e53*Math.cos(e52[1])*Math.sin(e52[0]) + e54[2];
	e51[1] = e53*Math.sin(e52[1]) + e54[1];
	e51[0] = e53*Math.cos(e52[1])*Math.cos(e52[0]) + e54[0];
	}
	
function initViewInfo(){
	e6 = o3djs.rendergraph.createBasicView(e4,
												 e9.transform,
												 e1.renderGraphRoot);
	e6.drawContext.projection = e5.matrix4.perspective(e5.degToRad(30),
																	  e1.width/e1.height,
																	  1,
																	  2000);
	e6.drawContext.view = e5.matrix4.lookAt(e51,
														e54,
														[0,1,0]);
	
	e6.clearBuffer.clearColorFlag = false;
	
	e7 = o3djs.rendergraph.createBasicView(e4,
													 e10.transform,
													 e1.renderGraphRoot);
	e7.drawContext.projection = e5.matrix4.orthographic(0.5,
																	   e1.width + 0.5,
																	   e1.height + 0.5,
																	   0.5,
																	   -10000,
																	   100);
	e7.drawContext.view = e5.matrix4.lookAt( [0, 0, 1],
															[0, 0, 0],
															[0, 1, 0]);
	
	e7.root.priority = e6.root.priority + 1;
	e7.clearBuffer.clearColorFlag = false;
	e7.zOrderedState.getStateParam("CullMode").value = e3.State.CULL_NONE;
	e7.zOrderedState.getStateParam("ZWriteEnable").value = false;
	
	e8 = o3djs.rendergraph.createBasicView(e4,
													 e47.transform,
													 e1.renderGraphRoot);
	e8.drawContext.projection = e5.matrix4.orthographic(0.5,
																	   e1.width + 0.5,
																	   e1.height + 0.5,
																	   0.5,
																	   100,
																	   1000);
	e8.drawContext.view = e5.matrix4.lookAt( [0, 0, 1],
															[0, 0, 0],
															[0, 1, 0]);
	
	e8.root.priority = e6.root.priority - 1;
	e8.clearBuffer.clearColorFlag = false;
	e8.zOrderedState.getStateParam("CullMode").value = e3.State.CULL_NONE;
	e8.zOrderedState.getStateParam("ZWriteEnable").value = false;
	}

function initEvent(){
	o3djs.event.addEventListener(e0,"mousedown",e130.startDragging);
	o3djs.event.addEventListener(e0,"mousemove",e130.drag);
	o3djs.event.addEventListener(e0,"mouseup",e130.stopDragging);
	o3djs.event.addEventListener(e0,"wheel",e130.e258);
	o3djs.event.addEventListener(e0,'keydown',e130.keyDown);
	
	o3djs.event.addEventListener(e0,'dblclick',e130.e131);
	}
	
	

function sortNumber(a,b){
	return a[0] - b[0];
	}
	
function sortFall(a,b){
    return a - b;	
	}
	
	
function compareDir(a,b){
	if (a[0]==b[0] && 
		a[1]==b[1] &&
		a[2]==b[2] &&
		a[3]==b[3] &&
		a[4]==b[4] &&
		a[5]==b[5]){
		return true;
		}
	return false;
	}

if(!Number.prototype.toFixed){
	Number.prototype.toFixed = function(n){  
									  return   Math.round(Math.Number(this)*Math.pow(10,n))/Math.pow(10,n);
									  }
	}   

String.prototype.longFixed = function(num){
	var returnString = this;
	returnString = returnString.slice(-num);
		for(var n=0;n < num-this.length;n++){
			returnString = "0" + returnString;
			}
	return returnString;
	}

function resizeClient(){
	e6.drawContext.projection = e5.matrix4.perspective(e5.degToRad(30),
																	  e1.width/e1.height,
																	  1,
																	  2000);
	
	e7.drawContext.projection = e5.matrix4.orthographic(0.5,
																	   e1.width + 0.5,
																	   e1.height + 0.5,
																	   0.5,
																	   -10000,
																	   100);
	
	e8.drawContext.projection = e5.matrix4.orthographic(0.5,
																	   e1.width + 0.5,
																	   e1.height + 0.5,
																	   0.5,
																	   100,
																	   1000);
	}


function e77(createX,createY){
	if (!e68[createX]){
		e68[createX] = new Array;
		if(!e68[createX][createY]){
			e68[createX][createY] = new Array;
			}
		}else if(!e68[createX][createY]){
			e68[createX][createY] = new Array;
			}
	} 


e64.e226 = function(num){
	var newTop = this[num];
	for(var nActive=num;nActive < e64.length-1;nActive++){
		this[nActive] = this[nActive+1];
		}
	this[nActive] = newTop;
	for(var n=0;n < this.length;n++){
		for(var i=0;i < this[n].length;i++){
			this[n][i].changeZ([n*300+i*30]);
			}
		}
	}
	
e64.e227 = function(num){
	var newTop = this[num];
	for(var nActive=num;nActive>0;nActive++){
		this[nActive] = this[nActive-1];
		}
	this[0] = newTop;
	for(var n=0;n < this.length;n++){
		for(var i=0;i < this[n].length;i++){
			this[n][i].changeZ([n*300+i*30]);
			}
		}
	}
var e78 = e78 || {};
 

e78.e79 = function(E) {
		var worldRay = o3djs.picking.clientPositionToWorldRay(
																E.x,
																E.y,
																e6.drawContext,
																e1.width,
																e1.height);
		
		var selectedCube = e78.e81(e62[e62.length-1],worldRay);
		
			if(selectedCube){
				for(var num=0;num < e63.length;num++){
					if (selectedCube[0] == e63[num][0]){
						e220.clearWireFrame(num);
						var directionArray = e63[num][3];
						
						for(var n=0;n < 6;n++){
							if(selectedCube[3][n]){
								directionArray[n] = directionArray[n] ? false : true ;
								break;
								}
							}
						if(   !(directionArray[0]||
								directionArray[1]||
								directionArray[2]||
								directionArray[3]||
								directionArray[4]||
								directionArray[5])){
							e63.splice(num,1);
							}
						return selectedCube;						
						
						}
					}
					e63.push(selectedCube);
					e63.sort(sortNumber);
					return selectedCube;
					}
					else if(e63[0]){
						e220.e216();
						e63 = [];
						}
		}

e78.e80 = function(E){

	var worldRay = o3djs.picking.clientPositionToWorldRay(
																E.x,
																E.y,
																e6.drawContext,
																e1.width,
																e1.height);
		
		var selectedCube = e78.e81(e62[e62.length-1],worldRay);
	return selectedCube;
	}
		

e78.e81 = function(e87,worldRay){
		var rayIntersectionInfo;
		var selectIntersectionInfo;
		var picked;
		var distance;
		var neardis;
		var selected;
		for(var n=0;n < e87.length;n++){
				rayIntersectionInfo = e87[n].boundingBox.intersectRay(worldRay.near,worldRay.far);
				if (rayIntersectionInfo.intersected){
					
					if (e87[n][0]){
						var selectMass = e78.e24(e87[n],worldRay);
						distance = selectMass[0];
						if (distance){
							if (!neardis || neardis > distance){
								neardis = distance;
								selectIntersectionInfo = selectMass[1];
								picked = n;
								selected = selectMass[2];
								}
							}
					    }
						else{
						distance = e5.lengthSquared(e5.subVector(worldRay.near,
																		   rayIntersectionInfo.position));
						if (!neardis || neardis > distance){
							neardis = distance;
							selectIntersectionInfo = rayIntersectionInfo;
							picked = n;
							selected = e87[picked];
							}
						}
					}
			}
		if (!selected){return;}
			
  		var returnDirection = new Array;
		var L = selected.l/2;
		returnDirection[0] = Math.abs(selectIntersectionInfo.position[0] - (selected.x + L)) < 0.0001;
		returnDirection[1] = Math.abs(selectIntersectionInfo.position[0] - (selected.x - L)) < 0.0001;
		returnDirection[2] = Math.abs(selectIntersectionInfo.position[1] - (selected.y + L)) < 0.0001;
		returnDirection[3] = Math.abs(selectIntersectionInfo.position[1] - (selected.y - L)) < 0.0001;
		returnDirection[4] = Math.abs(selectIntersectionInfo.position[2] - (selected.z + L)) < 0.0001;
		returnDirection[5] = Math.abs(selectIntersectionInfo.position[2] - (selected.z - L)) < 0.0001;
		
		var returnArray = [picked,selectIntersectionInfo,e87[picked],returnDirection,selected];
		
		return(returnArray);
	}
	
e78.e24 = function(e87,worldRay){
	var rayIntersectionInfo;
	var selectIntersectionInfo;
	var distance;
	var neardis;
	var selected;
	for(var n=0;n < e87.length;n++){
			rayIntersectionInfo = e87[n].boundingBox.intersectRay(worldRay.near,worldRay.far);
			if (rayIntersectionInfo.intersected){
				
				if (e87[n][0]){
					var selectMass = e78.e24(e87[n],worldRay);
					distance = selectMass[0];
					if (distance){
						if (!neardis || neardis > distance){
							neardis = distance;
							selectIntersectionInfo = selectMass[1];
							selected = selectMass[2];
							}
						}
					}
					else{
					distance = e5.lengthSquared(e5.subVector(worldRay.near,rayIntersectionInfo.position));
					if (!neardis || neardis > distance){
						selectIntersectionInfo = rayIntersectionInfo;
						neardis = distance;
						selected = e87[n];
						}
					}
				}
		}
	var returnArray = [neardis,selectIntersectionInfo,selected];
	return(returnArray);
	}
	

e78.e82 = function(E){
	if(e63[0]){
		var worldRay = o3djs.picking.clientPositionToWorldRay(
															E.x,
															E.y,
															e6.drawContext,
															e1.width,
															e1.height);
		var selectedMass = new Array;
		var selectedCube;
	
		for (var n=0;n < e63.length;n++){
			selectedMass[n] = e63[n][2];
			}
			
			selectedCube = e78.e81(selectedMass,worldRay);
			
			if(selectedCube){
				for(var n=0;n < 6;n++){
					if(selectedCube[3][n]){
						if(e63[selectedCube[0]][3][n]){
							selectedCube[5] = true;
							}
							else{
								selectedCube[5] = false;
								}
						}
					}
				return selectedCube;
				}
		}
	}

	
e78.e83 = function(e228,incluedeSelected){
	
	if(e228 && !e228[2][0]){
		var planCubeList = new Array;
		planCubeList[0] = new Array;
		planCubeList[1] = new Array;
		planCubeList[2] = e228[3];
		planCubeList[3] = new Array;
		var i = e228[2].x;
		var j = e228[2].y;
		var k = e228[2].z;
		var massParent = e228[2].parent;
		
		planCubeList[0].push(e228[2]);
		planCubeList[1].push(e228[0]);
		planCubeList[3].push(true);
		
		if(e228[3][0] || e228[3][1]){
			for (var n = 0;n < massParent.length;n++){
				if (!massParent[n][0] && massParent[n].x==i && n!=e228[0]){
					planCubeList[0].push(massParent[n]);
					planCubeList[1].push(n);
					}
				}
			}
			else if(e228[3][2] || e228[3][3]){
			for (var n = 0;n < massParent.length;n++){
				if (!massParent[n][0] && massParent[n].y == j && n!=e228[0]){
						planCubeList[0].push(massParent[n]);
						planCubeList[1].push(n);
					}
				}
				}
				else{
				for (var n = 0;n < massParent.length;n++){
					if (!massParent[n][0] && massParent[n].z == k && n!=e228[0]){
						planCubeList[0].push(massParent[n]);
						planCubeList[1].push(n);
						}
					}
					}
		return planCubeList;
		}
	}

e78.XYToWorldRay = function(x,y){
	return  o3djs.picking.clientPositionToWorldRay(
													x,
													y,
													e6.drawContext,
													e1.width,
													e1.height);
	}
	
e78.intersectRay = function(bounding,near,far){
	return bounding.intersectRay(near,far);
	}
	
	
e78.e84 = function(e87,E){
	var worldRay = o3djs.picking.clientPositionToWorldRay(
															E.x,
															E.y,
															e6.drawContext,
															e1.width,
															e1.height);
	var rayIntersectionInfo;
	var drawSelectArray = new Array;
	var distance;
	var neardis;
	var picked;
	for (var n = 0;n < e87[0].length;n++){
		
		rayIntersectionInfo = e78.intersectRay(e87[0][n].boundingBox,worldRay.near,worldRay.far);
		if(rayIntersectionInfo.intersected){
			
				distance = e5.lengthSquared(e5.subVector(worldRay.near,rayIntersectionInfo.position));
						if (!neardis || neardis > distance){
							neardis = distance;
							picked = n;
							}
			}
		}
	var addNew = true;
	if(picked && !e87[3][picked]){
		e87[3][picked] = true;
		
		for(var num=0;num < e63.length;num++){
			if (e87[1][picked] == e63[num][0]){
				addNew = false;
				e220.clearWireFrame(num);
				for(var n=0;n < 6;n++){
					if(e87[2][n]){
						
						
						
						e63[num][3][n] = e63[num][3][n] || e87[2][n];
						break;
						}
					}
				var directionArray = e63[num][3];
				if(   !(directionArray[0]||
						directionArray[1]||
						directionArray[2]||
						directionArray[3]||
						directionArray[4]||
						directionArray[5])){
					e63.splice(num,1);
					}
				break;
				}
			}
			if(addNew){
				drawSelectArray = [ e87[1][picked],
									rayIntersectionInfo,
									e87[0][picked],
									[e87[2][0],e87[2][1],e87[2][2],e87[2][3],e87[2][4],e87[2][5]],
									e87[0][picked]
									];
				e63.push(drawSelectArray);
				e63.sort(sortNumber);
			}
		}
	}
	

e78.e85 = function(e87,E){
	var worldRay = o3djs.picking.clientPositionToWorldRay(
															E.x,
															E.y,
															e6.drawContext,
															e1.width,
															e1.height);
	
	var rayIntersectionInfo;
	var drawSelectArray = new Array;
	var distance;
	var neardis;
	var picked;
	
	for (var n = 0;n < e87[0].length;n++){
		rayIntersectionInfo = e87[0][n].boundingBox.intersectRay(worldRay.near,worldRay.far);
		if(rayIntersectionInfo.intersected){
			
				distance = e5.lengthSquared(e5.subVector(worldRay.near,rayIntersectionInfo.position));
						if (!neardis || neardis > distance){
							neardis = distance;
							picked = n;
							}
			}
		
		}
		if(picked && !e87[3][picked]){
				e87[0][picked].red = e60.red;
				e87[0][picked].green = e60.green;
				e87[0][picked].blue = e60.blue;
				e87[0][picked].alpha = e60.alpha;
				e87[0][picked].e221(e60.red,
											   e60.green,
											   e60.blue,
											   e60.alpha);;
				e87[3][picked] = true;
		}
	
	}

e78.e86 = function(e228){
	if(e228){
		e60.red = e228[4].red;
		e60.green = e228[4].green;
		e60.blue = e228[4].blue;
		e60.alpha = e228[4].alpha;
		
		
		
		}
	}
	
	
var view = view || {};
 



view.e88 = function(centerAfter,e232){
	clearInterval(e11);
	if (!e232){
		e51[0] = e51[0] + centerAfter[0] - e54[0];
		e54[0] = centerAfter[0];	
		e51[1] = e51[1] + centerAfter[1] - e54[1];
		e54[1] = centerAfter[1];
		e51[2] = e51[2] + centerAfter[2] - e54[2];
		e54[2] = centerAfter[2];
		e6.drawContext.view = e5.matrix4.lookAt(
															e51,
															e54,
															[0,1,0]
															 );
		e110.e254();
		e11 = null;
		}
		else{
			var e233 = [e51[0],e51[1],e51[2],e54[0],e54[1],e54[2]];
			var centerL = new Array;
			centerL[0] = centerAfter[0] - e54[0];
			centerL[1] = centerAfter[1] - e54[1];
			centerL[2] = centerAfter[2] - e54[2];
			var n = 0;							
			e11 = setInterval(function(){view.e229(e233,centerL,n,e232);n++;},10);
			}
	}
	
view.e229 = function(e233,centerL,n,e232){
		e51[0] = e233[0] + Math.sin(PI/2*n/e232)*centerL[0];
		e54[0] = e233[3] + Math.sin(PI/2*n/e232)*centerL[0];	
		e51[1] = e233[1] + Math.sin(PI/2*n/e232)*centerL[1];
		e54[1] = e233[4] + Math.sin(PI/2*n/e232)*centerL[1];
		e51[2] = e233[2] + Math.sin(PI/2*n/e232)*centerL[2];
		e54[2] = e233[5] + Math.sin(PI/2*n/e232)*centerL[2];
							e6.drawContext.view = e5.matrix4.lookAt(
																			  e51,
																			  e54,
																			  [0,1,0]
																		  );
		e110.e254();
		if (n>=e232){
		clearInterval(e11);
		e11 = null;
		}
	}
	
	
	
view.PiRound = function(rad){
	if (rad>PI){
		rad -= 2*PI;
		}
		else if(rad<=-PI){
				rad += 2*PI;
			}
		return rad;
	}

view.e89 = function(angleAfter,e232){
	clearInterval(e11);
	if (!e232){
				e52 = angleAfter;
				e51[2] = e53*Math.cos(e52[1])*Math.sin(e52[0]) + e54[2];
				e51[1] = e53*Math.sin(e52[1]) + e54[1];
				e51[0] = e53*Math.cos(e52[1])*Math.cos(e52[0]) + e54[0];
				e6.drawContext.view = e5.matrix4.lookAt(
																  e51,
																  e54,
																  [0,1,0]
																  );
		e110.e254();
		e11 = null;
		}
		else{
			var angleBefore = e52;
			var angleL = new Array;
			angleL[0] = angleAfter[0] - angleBefore[0];
			angleL[1] = angleAfter[1] - angleBefore[1];
			var n = 0;
			e11 = setInterval(function(){angleSmooth(angleBefore,angleL,n,e232);n++;},10);
			}
	}
	


view.e90 = function(eyeRAfter,e232){
	clearInterval(e11);
	if(!e232){
		e53 = eyeRAfter;
		e53 = e53 < 3 ? 3 : e53;
		e51[2] = e53*Math.cos(e52[1])*Math.sin(e52[0]) + e54[2];
		e51[1] = e53*Math.sin(e52[1]) + e54[1];
		e51[0] = e53*Math.cos(e52[1])*Math.cos(e52[0]) + e54[0];
		e6.drawContext.view = e5.matrix4.lookAt(
														  e51,
														  e54,
														  [0,1,0]
														  );
		e110.e254();
		e11 = null;
		}
		else{
			var eyeRBefore = e53;
			var rL = eyeRAfter - eyeRBefore;
			var n = 0;
			e11 = setInterval(function(){view.e230(eyeRBefore,rL,n,e232);n++;},10);
			}	
	}


view.e230 = function(eyeRBefore,rL,n,e232) {
	e53 = eyeRBefore + Math.sin(PI/2*n/e232)*rL;
    e53 = e53 < 3 ? 3 : e53;
	e51[2] = e53*Math.cos(e52[1])*Math.sin(e52[0]) + e54[2];
	e51[1] = e53*Math.sin(e52[1]) + e54[1];
	e51[0] = e53*Math.cos(e52[1])*Math.cos(e52[0]) + e54[0];
    e6.drawContext.view = e5.matrix4.lookAt(
													  e51,
													  e54,
													  [0,1,0]
													  );
		e110.e254();
		if (n>=e232){
		clearInterval(e11);
		e58["zoomfalse"] = false;
		e11 = null;
		}
	}

view.e91 = function(e87){
	var maxMinCoor = new Array;
	var returnMaxMin = new Array;
	
		for (var m=0;m < e87.length;m++){
			if (e87[m][0]){ 
							returnMaxMin = view.e91(e87[m]);
							}
							else{returnMaxMin[0] = e87[m].x;
								  returnMaxMin[1] = e87[m].x;
								  returnMaxMin[2] = e87[m].y;
								  returnMaxMin[3] = e87[m].y;
								  returnMaxMin[4] = e87[m].z;
								  returnMaxMin[5] = e87[m].z;
								}
			maxMinCoor[0] = maxMinCoor[0] == undefined ? returnMaxMin[0] : Math.max(maxMinCoor[0],returnMaxMin[0]);
			maxMinCoor[1] = maxMinCoor[1] == undefined ? returnMaxMin[1] : Math.min(maxMinCoor[1],returnMaxMin[1]);
			maxMinCoor[2] = maxMinCoor[2] == undefined ? returnMaxMin[2] : Math.max(maxMinCoor[2],returnMaxMin[2]);
			maxMinCoor[3] = maxMinCoor[3] == undefined ? returnMaxMin[3] : Math.min(maxMinCoor[3],returnMaxMin[3]);
			maxMinCoor[4] = maxMinCoor[4] == undefined ? returnMaxMin[4] : Math.max(maxMinCoor[4],returnMaxMin[4]);
			maxMinCoor[5] = maxMinCoor[5] == undefined ? returnMaxMin[5] : Math.min(maxMinCoor[5],returnMaxMin[5]);
					}
	return maxMinCoor;
	}

view.e92 = function(){
	if (e62[e62.length-1][0]){
		if (!e18){
			var maxMinCoor = view.e91(e62[e62.length-1]);
			var ax = maxMinCoor[0];
			var bx = maxMinCoor[1];
			var ay = maxMinCoor[2];
			var by = maxMinCoor[3];
			var az = maxMinCoor[4];
			var bz = maxMinCoor[5];	
			var targetR = Math.max( Math.max(Math.abs(ax-bx+1),Math.abs(ay-by+1)),Math.abs(az-bz+1))*2; 
			var targetX = (ax + bx)/2;
			var targetY = (ay + by)/2;
			var targetZ = (az + bz)/2;
			if (targetR < 10){targetR = 10;}
			
			var eyeTar = [e52[0],e52[1],targetR,targetX,targetY,targetZ];
			if (!e55){
				e55 = [e52[0],e52[1],e53,e54[0],e54[1],e54[2]];
				view.e95(eyeTar,30);
				}
			else{
				view.e95(e55,30);
				e55 = null;
				}
			}
	}
	}
	
view.e93 = function(){
	var seleArray = new Array;
	for(var n=0;n < e63.length;n++){
		seleArray[n] = e63[n][2];
		}
		if (!e58["rotation"]){
			var maxMinCoor = view.e91(seleArray);
			var ax = maxMinCoor[0];
			var bx = maxMinCoor[1];
			var ay = maxMinCoor[2];
			var by = maxMinCoor[3];
			var az = maxMinCoor[4];
			var bz = maxMinCoor[5];	
			var targetR = Math.max( Math.max(Math.abs(ax-bx+1),Math.abs(ay-by+1)),Math.abs(az-bz+1))*2; 
			var targetX = (ax + bx)/2;
			var targetY = (ay + by)/2;
			var targetZ = (az + bz)/2;
			if (targetR < 10){targetR = 10;}
			var eyeTar = [e52[0],e52[1],targetR,targetX,targetY,targetZ];
			view.e95(eyeTar,30);
			}
	}
	
	




view.e94 = function(e87){
	var maxMinCoor = view.e91(e87);
	var ax = maxMinCoor[0];
	var bx = maxMinCoor[1];
	var ay = maxMinCoor[2];
	var by = maxMinCoor[3];
	var az = maxMinCoor[4];
	var bz = maxMinCoor[5];	
	var targetX = (ax + bx)/2;
	var targetY = (ay + by)/2;
	var targetZ = (az + bz)/2;
	view.e88([targetX,targetY,targetZ],20);
	}
	
view.e95 = function(e231,e232){
		clearInterval(e11);
		var e232 = !e232 ? 50 : e232;
		var e233 = [e52[0],e52[1],e53,e54[0],e54[1],e54[2]];
		var aL = e231[0] - e52[0];
		if (aL>PI){
			aL -= 2*PI;
			}
			else if(aL<-PI){
				aL += 2*PI;
				}
		var bL = e231[1] - e52[1];
		var rL = e231[2] - e53;
		var xL = e231[3] - e54[0];
		var yL = e231[4] - e54[1];
		var zL = e231[5] - e54[2];
		var n = 0;
		e11 = setInterval(function(){view.e234(e233,aL,bL,rL,xL,yL,zL,n,e232);n++;},10);
	}


view.e234 = function(e233,aL,bL,rL,xL,yL,zL,n,e232){
	
	
	e52[0] = e233[0] + Math.sin(PI/2*n/e232)*aL;
	e52[1] = e233[1] + Math.sin(PI/2*n/e232)*bL;
	e53 = e233[2] + Math.sin(PI/2*n/e232)*rL;
	e54[0] = e233[3] + Math.sin(PI/2*n/e232)*xL;
	e54[1] = e233[4] + Math.sin(PI/2*n/e232)*yL;
	e54[2] = e233[5] + Math.sin(PI/2*n/e232)*zL;
	
	e51[2] = e53*Math.cos(e52[1])*Math.sin(e52[0]) + e54[2];
	e51[1] = e53*Math.sin(e52[1]) + e54[1];
	e51[0] = e53*Math.cos(e52[1])*Math.cos(e52[0]) + e54[0];
	
	e6.drawContext.view = e5.matrix4.lookAt(
													  e51,
													  e54,
													  [0,1,0]
													  );
		e110.e254();
	if (n>=e232){
		clearInterval(e11);
		e11 = null;
		}
	}
	
	
	

	
var e96 = e96 || {};


e96.init = function(){
	e76 = o3djs.material.createMaterialFromFile(e4,
															 materialUrls[0],
															 e8.zOrderedDrawList);
	e76.getParam("colorMult").value = [1, 1, 1, 1];
	e76.drawList = e8.zOrderedDrawList;
	e48[5] = o3djs.primitives.createPlane(e4,
												e76,
												1,
												1,
												1,
												1,
												[[1, 0, 0, 0],
												[0, 0, 1, 0],
												[0,-1, 0, 0],
												[0, 0, 0, 1]]);
	
	
	var repectTexture = e96.e97([1,1,1,1],10,700);
	for(var n=0;n < 200;n++){
		e47[n] = new e96.e98("chips0",[],[repectTexture],[],[]);
		e47[n].e138(n*10,0);
		e47[n].changeZ(-500);
		}
	}
	
e96.e97 = function(color,width,height,e33){
	
			var bgColorTexture = e4.createTexture2D(
														 width,
														 height,
														 o3djs.base.o3d.Texture.ARGB8,
														 1,
														 false);
			
			var linearPaint = e4.createObject('CanvasPaint');

			
			var bgImageCanvas = e4.createObject("Canvas");
			bgImageCanvas.setSize(width,height);
			
			if(color[0][0] != undefined){
				bgImageCanvas.clear([0,0,0,0]);
				var gradientShader = e4.createObject("CanvasLinearGradient");
				switch(e33){
					case "leftToRight":
						gradientShader.startPoint = [-1, 0];
						gradientShader.endPoint = [width-1, 0];
						break;
					case "rightToLeft":
						gradientShader.startPoint = [width-1, 0];
						gradientShader.endPoint = [-1, 0];
						break;
					case "downToUp":
						gradientShader.startPoint = [0, height-1];
						gradientShader.endPoint = [0, -1];
						break;
					case "upToDown":
						gradientShader.startPoint = [0, 0];
						gradientShader.endPoint = [0, height];
						break;
					default :
						gradientShader.startPoint = [0, 0];
						gradientShader.endPoint = [width, 0];
						break;
					}
					gradientShader.colors = color;
					gradientShader.positions = [];
					gradientShader.tileMode = e3.CanvasShader.REPEAT;
				linearPaint.shader = gradientShader;
				bgImageCanvas.drawRect(0,0,width,height,linearPaint);
				}
			else{
				bgImageCanvas.clear(color);
				}
			bgColorTexture.drawImage(bgImageCanvas,0,height-1,width,-height,
									   0,0,0,width,height
									   );	
			return bgColorTexture;
	}

	
	
e96.e98 = function(name,text,e235,e236,e237,e238){
	this.name = name;
	this.x = 0;
	this.y = 0;
	this.z = e238 == undefined ? 0 : e238;
	
	this.textContent = text[0];
	this.textCoordinateX = text[1] ? text[1] : 0;
	this.textCoordinateY = text[2] ? text[2] : 0;
	this.textTypeface = text[3] ? text[3] : "Microsoft YaHei";
	this.textSize = text[4] ? text[4] : 10;
	this.textColor = text[5] ? text[5] : [0,0,0,1];
	this.e245 = text[6] ? text[6] : 99999999;
	
	this.bgImageTexture = e235[0];
	this.e241 = e235[1] != undefined ? e235[1] : 1;
	this.e239 = e235[2];
	this.e240 = e235[3];
	
	this.e236 = e236[0];
	this.e243 = e236[1];
	this.e244 = e236[2];
	this.e242 = e236[3];
	
	if(e237["activeDown"]){
		this.activeDown = e237["activeDown"];
		}
		else{
			this.activeDown = function(){};
			}
			
	if(e237["activeOver"]){
		this.activeOver = e237["activeOver"];
		}
		else{
			this.activeOver = function(){};
			}
			
	if(e237["activeUp"]){
		this.activeUp = e237["activeUp"];
		}
		else{
			this.activeUp = function(){};
			}
	if(e237["activeDrag"]){
		this.activeDrag = e237["activeDrag"];
		}
		else{
			this.activeDrag = function(){};
			}
	if(e237["activeLeave"]){
		this.activeLeave = e237["activeLeave"];
		}
		else{
			this.activeLeave = function(){};
			}
	
	if(e237["defultFunction"]){
		this.defultFunction = e237["defultFunction"];
		}
		else{
			this.defultFunction = function(){};
		}
			
	this.transform = e4.createObject("Transform");
	this.transform.parent = e47.transform;
	this.e246 = e4.createObject("Transform");
	this.e246.parent = this.transform;
	
	this.transform.translate(0,0,this.z);
	
	if(this.bgImageTexture){
		this.e247 = e4.createObject("Transform");
		this.e247.parent = this.e246;
		
		this.bgImageTransform = e4.createObject("Transform");
		this.bgImageTransform.parent = this.e247;
		
		this.bgImageSampler = e4.createObject('Sampler');
		this.bgImageSampler.addressModeU = e3.Sampler.CLAMP;
		this.bgImageSampler.addressModeV = e3.Sampler.CLAMP;
		
		this.bgImageParamSampler = this.bgImageTransform.createParam('texSampler0',
														'ParamSampler');
		this.bgImageParamSampler.value = this.bgImageSampler;
		this.bgImageParamColorMult = this.bgImageTransform.createParam('colorMult',
														'ParamFloat4');
		
		this.bgImageParamColorMult.set(1, 1, 1, this.e241);
		
		this.bgImageSampler.texture = this.bgImageTexture;
		this.bgImageTransform.addShape(e48[5]);	
		
			if(this.e239 && this.e240){
				this.width = this.e239;
				this.height = this.e240;
				}
			else{
				this.width = this.bgImageTexture.width;
				this.height = this.bgImageTexture.height;
				}
		this.bgImageTransform.translate(this.width/2,this.height/2,0);
		this.bgImageTransform.scale(this.width,-this.height,1);
		
		
		}
		else if(this.e236  && this.e236[0] != undefined){
			this.width = this.e243;
			this.height = this.e244;
			
			this.e247 = e4.createObject("Transform");
			this.e247.parent = this.e246;
			
			this.bgImageTransform = e4.createObject("Transform");
			this.bgImageTransform.parent = this.e247;
			
			this.bgColorTexture = e4.createTexture2D(
														 this.width,
														 this.height,
														 o3djs.base.o3d.Texture.ARGB8,
														 1,
														 false);
			
			var linearPaint = e4.createObject('CanvasPaint');

			
			this.bgImageCanvas = e4.createObject("Canvas");
			this.bgImageCanvas.setSize(this.width,this.height);
			
			if(this.e236[1][0] != undefined){
				this.bgImageCanvas.clear([0,0,0,0]);
				var gradientShader = e4.createObject("CanvasLinearGradient");
				switch(this.e242){
					case "leftToRight":
						gradientShader.startPoint = [-1, 0];
						gradientShader.endPoint = [this.width-1, 0];
						break;
					case "rightToLeft":
						gradientShader.startPoint = [this.width-1, 0];
						gradientShader.endPoint = [-1, 0];
						break;
					case "downToUp":
						gradientShader.startPoint = [0, this.height-1];
						gradientShader.endPoint = [0, -1];
						break;
					case "upToDown":
						gradientShader.startPoint = [0, 0];
						gradientShader.endPoint = [0, this.height];
						break;
					default :
						gradientShader.startPoint = [0, 0];
						gradientShader.endPoint = [this.width, 0];
						break;
					}
					gradientShader.colors = this.e236;
					gradientShader.positions = [];
					gradientShader.tileMode = e3.CanvasShader.REPEAT;
				linearPaint.shader = gradientShader;
				this.bgImageCanvas.drawRect(0,0,this.width,this.height, linearPaint);
				}
			else{
				this.bgImageCanvas.clear(this.e236);
				}
			this.bgColorTexture.drawImage(this.bgImageCanvas,0,this.height-1,this.width,-this.height,
									   0,0,0,this.width,this.height
									   );
			this.bgImageSampler = e4.createObject('Sampler');
			this.bgImageSampler.addressModeU = e3.Sampler.CLAMP;
			this.bgImageSampler.addressModeV = e3.Sampler.CLAMP;
			
			this.bgImageParamSampler = this.bgImageTransform.createParam('texSampler0',
															'ParamSampler');
			this.bgImageParamSampler.value = this.bgImageSampler;
			this.bgImageParamColorMult = this.bgImageTransform.createParam('colorMult',
															'ParamFloat4');
			this.bgImageParamColorMult.set(1, 1, 1, 1);
				
			this.bgImageSampler.texture = this.bgColorTexture;
			this.bgImageTransform.addShape(e48[5]);	
			
			this.bgImageTransform.translate(this.width/2,this.height/2,0);
			this.bgImageTransform.scale(this.width,-this.height,1);
			
			}
			else if(this.e236 == undefined){
				this.width = this.e243;
				this.height = this.e244;
				}
	
	if(this.textContent){
		this.textMoveTransform = e4.createObject("Transform");
		this.textMoveTransform.parent = this.e246;
		
		this.textTransform = e4.createObject("Transform");
		this.textTransform.parent = this.textMoveTransform;
		
		
		this.textPaint = e4.createObject("CanvasPaint");
		this.textPaint.color = this.textColor;
		this.textPaint.textSize = this.textSize;
		this.textPaint.textTypeface = this.textTypeface;
		var fontBox = this.textPaint.measureText(this.textContent);
		this.textWidth = fontBox[2]-fontBox[0];
		this.textHeight = fontBox[3]-fontBox[1];
			if(this.textWidth>this.e245){
				
				var writeInRows = true;
				var splitText = e132.e133(this.textPaint,this.textContent,this.e245);
				fontBox = this.textPaint.measureText(splitText[0]);
				this.textWidth = this.e245;
				this.textHeight = (fontBox[3]-fontBox[1]+3)*splitText.length;
				}
		
		if (this.textHeight%2 != 0){this.textHeight = this.textHeight +1;}
		if (this.textWidth %2 != 0){this.textWidth = this.textWidth +1;}
		
		this.textTexture = e4.createTexture2D(
													 this.textWidth,
													 this.textHeight,
													 o3djs.base.o3d.Texture.ARGB8,
													 1,
													 false);
		this.textCanvas = e4.createObject("Canvas");
		this.textCanvas.setSize(this.textWidth,this.textHeight);
		this.textCanvas.clear([1,1,1,0]);
		this.textTexture.drawImage(this.textCanvas,0,this.textHeight-1,this.textWidth,-this.textHeight,
								   0,0,0,this.textWidth,this.textHeight
								   );
		
			if(writeInRows){
				for(var nRows=0;nRows < splitText.length;nRows++){
					this.textCanvas.drawText(splitText[nRows],
										 -fontBox[0],
										 (fontBox[3]-fontBox[1])*(nRows+1)-fontBox[3]+nRows*3,
										 this.textPaint);
					}
				}
			else{
				this.textCanvas.drawText(this.textContent,
									 -fontBox[0],
									 this.textHeight-fontBox[3],
									 this.textPaint);
				}
		
		this.textTexture.drawImage(this.textCanvas,0,this.textHeight-1,this.textWidth,-this.textHeight,
								   0,0,0,this.textWidth,this.textHeight
								   );
		this.textSampler = e4.createObject('Sampler');
		this.textSampler.addressModeU = e3.Sampler.CLAMP;
		this.textSampler.addressModeV = e3.Sampler.CLAMP;
		
		this.textParamSampler = this.textTransform.createParam('texSampler0',
														'ParamSampler');
		this.textParamSampler.value = this.textSampler;
		this.textParamColorMult = this.textTransform.createParam('colorMult',
														'ParamFloat4');
		
		this.textParamColorMult.set(1, 1, 1, 1);
		
		this.textSampler.texture = this.textTexture;
		this.textTransform.addShape(e48[5]);	
		
		this.textTransform.translate(this.textWidth/2,this.textHeight/2,0.001);
		this.textTransform.scale(this.textWidth,-this.textHeight,1);
		
		if (!this.width){
			this.width = this.textWidth;
		}
		if (!this.height){
			this.height = this.textHeight;
 			}
		
		if (this.textCoordinateX  == "left"){
			this.textMoveTransform.translate(3,0,0);
			}else if (this.textCoordinateX  == "center"){
				this.textMoveTransform.translate(Math.round((this.width - this.textWidth - 3)/2),0,0);
				}else if(this.textCoordinateX  == "right"){
					this.textMoveTransform.translate(this.width - this.textWidth,0,0);
					}else {
						this.textMoveTransform.translate(this.textCoordinateX,0,0);
						}
		if (this.textCoordinateY  == "top"){
			this.textMoveTransform.translate(0,3,0);
			}else if (this.textCoordinateY  == "middle"){
				this.textMoveTransform.translate(0,Math.round((this.height - this.textHeight)/2),0);
				}else if(this.textCoordinateY  == "bottom"){
					this.textMoveTransform.translate(0,this.height - this.textHeight - 3,0);
					}else{
						this.textMoveTransform.translate(0,this.textCoordinateY,0);
						}
		}
	}

e96.e98.prototype.e138 = function(x,y){
	this.x = x;
	this.y = y;
	this.transform.identity();
	this.transform.translate(x,y,this.z);
	
	}
	
e96.e98.prototype.changeZ = function(z){
	this.z = z;
	this.transform.identity();
	this.transform.translate(this.x,this.y,z);
	}
	
var e99 = new Array; 

var e100 = e100 || {};

e100.e248 = function(){
	var e231 = [PI/2,PI/2-0.001,e53,e54[0],e54[1],e54[2]];
	view.e95(e231,30);
	}
	
e100.e249 = function(){
	var e231 = [PI/2,0,e53,e54[0],e54[1],e54[2]];
	view.e95(e231,30);
	}	
	
e100.e250 = function(){
	var e231 = [PI,0,e53,e54[0],e54[1],e54[2]];
	view.e95(e231,30);
	}
	
e100.e251 = function(){
	var e231 = [PI*3/4,PI/4,e53,e54[0],e54[1],e54[2]];
	view.e95(e231,30);
	}	
	
e100.e252 = function(){
	e220.e216();
	e63 = [];
	}

e100.e101 = function(){
	e110.e101();
	}


e100.e102 = function(){
			e62.push(e63[0][2]);	
			e110.e30(e62[e62.length-1],0.1);
			e220.e216();
			e63 = [];
			view.e92();
	}

e100.e103 = function(){
	if(!e58["penMode"]){
			if(!e174){
			e132.e188();
			e58["penMode"] = true;
				}
				else{
					e132.e156(e174,0,0);
					e174.e167();
					e58["penMode"] = true;
					}
		e15 = "NONE";
		if(!e17){
			e132.e197([
											e60.red,
											e60.green,
											e60.blue,
											1
											]);
			}else{
				e17.e139([1]);
				}
					
		}else{
			e15 = "DEFAULT";
			e17.e139([0]);
			
			var checkNum = e174.e170();
			if(checkNum != undefined){
				e58["penMode"] = false;
				e174.e169();
				e132.e156(e174,-e174.width,0);
				e132.tips.hidden();
				}
			}
	}

var e104 = e104 || {};

	
e104.e105 = function(menuMassArray,menuDataArray){
	e65.push(menuMassArray);
	if(!menuMassArray.transform){
		menuMassArray.transform = e4.createObject("Transform");
		}
	for(var n=0;n < menuDataArray.length;n++){
		if(menuDataArray[n][0]){
			menuMassArray[n] = new Array;
			e104.e109.call(menuMassArray[n],menuDataArray[n].textureData,menuDataArray[n].size);
			e104.e105(menuMassArray[n],menuDataArray[n]);
			menuMassArray[n].action = menuDataArray[n].action;
			}
			else{
				menuMassArray[n] = new e104.e109(menuDataArray[n].textureData,menuDataArray[n].size);
				menuMassArray[n].action = menuDataArray[n].action;
				}
		}
	e65.pop();
	}

e104.init = function(){
	e104.e25();
	
	e75 = o3djs.material.createMaterialFromFile(e4,
															 materialUrls[0],
															 e7.zOrderedDrawList);
	e75.getParam("colorMult").value = [1, 1, 1, 1];
	e75.drawList = e7.zOrderedDrawList;
	e48[3] = o3djs.primitives.createPlane(e4,
												e75,
												1,
												1,
												1,
												1,
												[[1, 0, 0, 0],
												[0, 0, 1, 0],
												[0,-1, 0, 0],
												[0, 0, 0, 1]]);
	
	
	
	e10[0] = new Array;
	e104.e105(e10[0],e46[0]);
	e10[1] = new Array;
	e104.e105(e10[1],e46[1]);
	e10[2] = new Array;
	e104.e105(e10[2],e46[2]);
	e10[3] = new Array;
	e104.e105(e10[3],e46[3]);
	e10[4] = new Array;
	e104.e105(e10[4],e46[4]);
	}



e104.e25 = function(){
	
	
	e253 = new Array;
	
	e253[0] = [,,,,,
						   [0,80,0.66,textures["menu_colorPen"],e100.e103],
						   [7,80,0.66,textures["menu_ctrl_a"],e110.e123],
						   [6,80,0.66,textures["menu_r"],e220.e206],
						   
						   [3,80,0.66,textures["menu_blank"],view.e92],
						   [2,80,0.66,textures["menu_review"],function (){},
								[0,80,0.66,textures["menu_right"],e100.e251],
								[2,80,0.66,textures["menu_down"],e100.e249],
								[4,80,0.66,textures["menu_left"],e100.e250],
								[6,80,0.66,textures["menu_up"],e100.e248]
								]
						   
						  ];
	e46[0] = e104.e106(e253[0]);	
	
	e253[1] = [,,,,,
						   [0,80,0.66,textures["menu_colorPen"],e100.e103],
						   [7,80,0.66,textures["menu_ctrl_a"],e110.e123],
						   [6,80,0.66,textures["menu_r"],e220.e206],
						   [5,80,0.66,textures["menu_esc"],e100.e252],
						   [3,80,0.66,textures["menu_blank"],view.e92],
						   [2,80,0.66,textures["menu_review"],function (){},
								[0,80,0.66,textures["menu_right"],e100.e251],
								[2,80,0.66,textures["menu_down"],e100.e249],
								[4,80,0.66,textures["menu_left"],e100.e250],
								[6,80,0.66,textures["menu_up"],e100.e248]
								],
						   [1,80,0.66,textures["menu_f"],view.e93]
						  ];
	e46[1] = e104.e106(e253[1]);	
	
	e253[2] = [,,,,,
						   [0,80,0.66,textures["menu_c"],e100.e101],
						   [7,80,0.66,textures["menu_g"],e110.e124],
						   [6,80,0.66,textures["menu_e"],e100.e102],
						   [5,80,0.66,textures["menu_ctrl_g"],e110.e126],
						   [4,80,0.66,textures["menu_del"],e110.e119]
						   
						  ];
	e46[2] = e104.e106(e253[2]);
	
	e253[3] = [,,,,,
						   [0,80,0.66,textures["menu_c"],e100.e101],
						   [7,80,0.66,textures["menu_g"],e110.e124],
						   
						   
						   [4,80,0.66,textures["menu_del"],e110.e119],
						   [2,80,0.66,textures["menu_m"],e110.e129]
						  ];
	e46[3] = e104.e106(e253[3]);
	
	e253[4] = [,,,,,
						   [0,80,0.66,textures["menu_c"],e100.e101],
						   [7,80,0.66,textures["menu_g"],e110.e124],
						   [6,80,0.66,textures["menu_e"],e100.e102],
						   [5,80,0.66,textures["menu_ctrl_g"],e110.e126],
						   [4,80,0.66,textures["menu_del"],e110.e119],
						   [2,80,0.66,textures["menu_m"],e110.e129]
						  ];
	e46[4] = e104.e106(e253[4]);
	
	}	
	
e104.e106 = function(menuArray,menuDataArray,menuDataParent){
		if(menuArray[5]){
			menuDataArray = new Array;
			for(var n=5;n < menuArray.length;n++){
				menuDataArray[n-5] = new Object;
				menuDataArray[n-5] = e104.e106(menuArray[n],menuDataArray[n-5],menuDataArray);
				menuDataArray[n-5].angle = menuArray[n][0]*PI/4;
				menuDataArray[n-5].r = menuArray[n][1];
				menuDataArray[n-5].size = menuArray[n][2];
				menuDataArray[n-5].parent = menuDataArray;
				menuDataArray[n-5].textureData = menuArray[n][3];
				menuDataArray[n-5].action = menuArray[n][4];
				if(n == menuArray.length-1){
					return menuDataArray
					}
				}
			}
			else{
				menuDataArray.angle = menuArray[0]*PI/4;
				menuDataArray.r = menuArray[1];
				menuDataArray.size = menuArray[2];
				menuDataArray.parent = menuDataParent;
				menuDataArray.textureData = menuArray[3];
				menuDataArray.action = menuArray[4];
				return menuDataArray
				}
	}

e104.e26 = function(menuNow,menuData,menuNo){
	var menuCenterX = e49[2];
	var menuCenterY = e49[3];
	if (menuNow.parent){
		
		if (menuNow[0]){
			var menuParent = menuNow.parent; 
			clearInterval(e11);
			var e232 = 20;
			var step = 0;
			var menuOffset = new Array;
			menuOffset['x'] = [];
			menuOffset['y'] = [];
			for (var n = 0;n < menuNow.length;n++){
				var menuOffsetX = menuData[n].r * Math.cos(menuData[n].angle);
				var menuOffsetY = menuData[n].r * Math.sin(menuData[n].angle);
				menuOffset['x'].push(menuOffsetX);
				menuOffset['y'].push(menuOffsetY);
				menuNow[n].centerX = menuOffsetX + menuNow.centerX;   
				menuNow[n].centerY = menuOffsetY + menuNow.centerY;
				menuNow[n].transform.identity();
				}
				
			e11 = setInterval(function(){e104.e28(menuNow,menuData,e232,step,menuOffset);step++;},10);
			
			for(var menuUpN = 0 ;menuUpN < menuParent.length;menuUpN++){
				if (menuParent[menuUpN]!=menuNow){
				menuParent[menuUpN].e138(0,0); 
				menuParent[menuUpN].centerX = menuParent.centerX;  
				menuParent[menuUpN].centerY = menuParent.centerX;
				menuParent[menuUpN].e31(0);
					}
				}
		}
			else{
				menuData.action();
				e10.transform.identity();
				e99 = [];
				e104.e108(e10[menuNo]);
				e10[menuNo].transform.parent = null;
				e10[menuNo].centerX = e10[menuNo].centerY = undefined;
				}
		}else{ 
				if (menuNow.centerX == undefined){
				menuNow.transform.identity();
				menuNow.transform.translate(menuCenterX,menuCenterY,0);
			    menuNow.centerX = menuCenterX;
				menuNow.centerY = menuCenterY;
				}
				clearInterval(e11);
				var e232 = 30;
				var step = 0;
				var menuOffset = new Array;
				menuOffset['x'] = [];
				menuOffset['y'] = [];
				for (var n = 0;n < menuNow.length;n++){
					var menuOffsetX = menuData[n].r * Math.cos(menuData[n].angle);
					var menuOffsetY = menuData[n].r * Math.sin(menuData[n].angle);
					menuOffset['x'].push(Math.round(menuOffsetX));
					menuOffset['y'].push(Math.round(menuOffsetY));
					menuNow[n].centerX = menuOffsetX + menuNow.centerX;   
					menuNow[n].centerY = menuOffsetY + menuNow.centerY;
					menuNow[n].transform.identity();
					}
			e11 = setInterval(function(){e104.e28(menuNow,menuData,e232,step,menuOffset);step++;},10);
			}
	};

e104.cancel = function(){
	if (e99.length!=0){
			e104.e108(e10[e99[0]]);
			e10[e99[0]].transform.parent = null;
			e10[e99[0]].centerX = e10[e99[0]].centerY = undefined;				
			e99 = [];
		}
	}

e104.e107 = function(E,menuNo){
	if (e99.length == 0){
		e99.push(menuNo); 
		e104.e108(e10[menuNo]);
		e104.e26(e10[menuNo],e46[menuNo],menuNo);
		}
		else{
			var menuLevelMass = e104._levelCallBack(e10,e99);
			var menuLevelMassData = e104._levelCallBack(e46,e99);
			var sortDistence = new Array;
			var sortZindex = new Array;
			var breakNotYet = true;
			for (var n=0;n < menuLevelMass.length;n++){
					var responseDistance = 
					Math.sqrt(Math.pow((menuLevelMass[n].centerX-E.x),2)+Math.pow((menuLevelMass[n].centerY-E.y),2));
					
					e104.e27(responseDistance,menuLevelMass[n]);
					
					sortDistence.push([responseDistance,n]);
					sortZindex.push(menuLevelMass[n].e238);
					if (responseDistance < 32){
						e99.push(n);
						e104.e108(e10[menuNo]);
						e104.e26(menuLevelMass[n],menuLevelMassData[n],menuNo);
						breakNotYet = false;
						break;
						}
				}
				if(breakNotYet){e104.e29(sortDistence,sortZindex);}
				}
	}
	

e104._levelCallBack = function(e87,levelArray){
	var levelMass = e87;
		for (var n = 0;n < levelArray.length;n++){
		levelMass = levelMass[levelArray[n]];
			}
	return levelMass;
}



e104.e27 = function(distence,menuThis){
	if (distence >= 32){
	menuThis.scale(715.5/distence/Math.pow(distence,0.5)*menuThis.size);
	}
	}


e104.e28 = function(menuBoss,menuData,e232,step,menuOffset){
	var shareStep;
	for (var an = 1;an < e232;an++){
		if ((e232-an)%(2*(menuBoss.length-1)) == 0){
			shareStep = an;
			break;
			}
		}
	var gapStep =(e232-shareStep)/(2*(menuBoss.length-1));
	
	
	
	for (var n=0;n < menuBoss.length;n++){
		var startStep = n*gapStep;
		var endStep = e232 - (menuBoss.length-n-1)*gapStep-1;
		var afterStep = endStep - startStep +1;
		
		if (step>=startStep && step<=endStep){
		menuBoss[n].e138(menuOffset['x'][n]/Math.sin(0.7*PI)*Math.sin((step-startStep+1)/afterStep*PI*0.7),
						   menuOffset['y'][n]/Math.sin(0.7*PI)*Math.sin((step-startStep+1)/afterStep*PI*0.7),
									  0);
			
		menuBoss[n].e31(Math.sin((step-startStep+1)/afterStep*PI/2));
			}
		}
	if (step>=e232){
		clearInterval(e11);
		e11 = null;
		}
	}

e104.e29 = function(sortDistence,sortZindex){
	sortDistence.sort(sortNumber);
	sortZindex.sort(sortFall);
	var nowMenuMass = e104._levelCallBack(e10,e99);
	for (var i =0,j=nowMenuMass.length-1;i < nowMenuMass.length;i++,j--){
		nowMenuMass[sortDistence[i][1]].changeZ(sortZindex[j]);
		}
	}

	
	
e104.e108 = function(menuArea){
	for (var n=0;n < menuArea.length;n++){
		if (menuArea[n][0]){
			menuArea[n].e31(0);
			e104.e108(menuArea[n]);
			}
			else {
				menuArea[n].e31(0);
				}
		}
	}	
	
e104.e109 = function(texture,size,x,y,alpha,e238){
	this.x = x ? x : 0;
	this.y = y ? y : 0;
	this.e238 = e238 == undefined ? e20++ : e238;
	this.alpha = alpha ? alpha : 0;
	this.texture = texture;
	this.size = size;
	
	this.transform = e4.createObject("Transform");
	this.transform.parent = e65[e65.length-1].transform;
	this.parent = e65[e65.length-1];
	this.transform.translate(0,0,this.e238);
	
	this.e246 = e4.createObject("Transform");
	this.e246.parent = this.transform;
	
	this.sampler = e4.createObject('Sampler');
	this.sampler.addressModeU = e3.Sampler.CLAMP;
	this.sampler.addressModeV = e3.Sampler.CLAMP;
	
	this.paramSampler = this.e246.createParam('texSampler0',
													'ParamSampler');
	this.paramSampler.value = this.sampler;
	this.paramColorMult = this.e246.createParam('colorMult',
                                                    'ParamFloat4');
	this.paramColorMult.set(1, 1, 1, this.alpha);
	this.sampler.texture = texture;
	this.e246.addShape(e48[3]);	
	
	this.e246.scale(texture.width*size, -texture.height*size, 1);
	
	this.e138 = function(x,y){
		this.transform.identity();
		this.transform.translate(x,y,this.e238);
		this.x = x;
		this.y = y;
		}
	this.e31 = function(alpha){
		this.paramColorMult.set(1, 1, 1, alpha);
		this.alpha = alpha;
		}
	this.scale = function(scaleAll){
		this.e246.identity();
		this.e246.scale(this.texture.width*scaleAll,-this.texture.width*scaleAll,1);
		
		}
	this.changeZ = function(e238){
		this.e238 = e238;
		this.transform.identity();
		this.transform.translate(this.x,this.y,this.e238);
		}	
	}

var e110 = e110 || {};


e110.e111 = function(e87){
	var stringArray = new Array;
	var tempCube;
	
	stringArray[0] =	"["+
						(e87.localX+648).toString(36).longFixed(2)+
						(e87.localY+648).toString(36).longFixed(2)+
						(e87.localZ+648).toString(36).longFixed(2)+
						"-";
	for(var nCube=0;nCube < e87.length;nCube++){
		if(!e87[nCube][0]){
			tempCube = e87[nCube];
			stringArray[stringArray.length] = 	(tempCube.alpha*10).toString(16)+
												parseInt(tempCube.red*255).toString(16).longFixed(2)+
												parseInt(tempCube.green*255).toString(16).longFixed(2)+
												parseInt(tempCube.blue*255).toString(16).longFixed(2)+
												(tempCube.localX+648).toString(36).longFixed(2)+
												(tempCube.localY+648).toString(36).longFixed(2)+
												(tempCube.localZ+648).toString(36).longFixed(2);
			}
			else{
				stringArray[stringArray.length] = e110.e111(e87[nCube]);
				}
		}
	stringArray[stringArray.length] = "]";
	return stringArray.join("");
	}

e110.e112 = function(stringData){
	e110.e113(stringData);
	}

e110.e113 = function(stringData){
	var shiftN = 0;
	var n = 0;
	var createN = 0;
	while(n*13+shiftN < stringData.length){
		var label = stringData.substr(n*13+shiftN,1);
		if(label == "["){
			var newMass = new Array;
				newMass.transform = e4.createObject("Transform");
				newMass.transform.parent = e62[e62.length-1].transform;
				newMass.parent = e62[e62.length-1];
				newMass.localX = parseInt(stringData.substr(n*13+shiftN+1,2),36)-648;
				newMass.localY = parseInt(stringData.substr(n*13+shiftN+3,2),36)-648;
				newMass.localZ = parseInt(stringData.substr(n*13+shiftN+5,2),36)-648;
				newMass.x = newMass.localX + newMass.parent.x;
				newMass.y = newMass.localY + newMass.parent.y;
				newMass.z = newMass.localZ + newMass.parent.z;
				newMass.transform.translate(newMass.localX,newMass.localY,newMass.localZ);
			e62[e62.length-1].push(newMass);
			e62.push(newMass);
			shiftN += 8;
			e110.e113(stringData.substr(n*13+shiftN));
			break;
			}
		else if(label == "]"){
			e62.pop();
			shiftN += 1;
			if(!createN && n){
				
				var tempMass = e62[e62.length-1][e62[e62.length-1].length-1];
				e4.removeObject(tempMass.transform);
				tempMass.transform.parent = null;
				tempMass.parent = null;
				e62[e62.length-1].pop();
				}
			}
		else{
			var newCube = e110.e114(stringData.substr(n*13+shiftN,13));
			if(newCube){createN++;}
			n++;
			}
		}
	return newMass;
	}

e110.e114 = function(stringData){
	var newCube = new e220.e219(	e48[0].cubeShape,
										parseInt(stringData.substr(1,2),16)/255,
										parseInt(stringData.substr(3,2),16)/255,
										parseInt(stringData.substr(5,2),16)/255,
										parseInt(stringData.substr(0,1),16)/10,
										parseInt(stringData.substr(7,2),36)-648,
										parseInt(stringData.substr(9,2),36)-648,
										parseInt(stringData.substr(11,2),36)-648,
										1);
			if(newCube.transform){
				newCube.comAndUpDataBounding();
				e62[e62.length-1].push(newCube);
				return newCube;
				}
	}












































e110.e115 = function(){
	var o3dDiv = document.getElementById("o3d");
	o3dDiv.style.width = "256px";
	o3dDiv.style.height = "256px";
	}

e110.e254 = function(){
	e48[0].e255();
	e66.e255();
	e67.e255();
	}

e110.e30 = function(e87,alpha,just){
	if(e63[e63.length-1]){
		e110._alphaIn(e87,alpha);
		}
		else{
			e110._alphaOut(e87,just);
			}
	}
e110._alphaIn = function(e87,alpha){
	e110.e31(e87.parent,alpha);
	e110.e31(e87,1);
	}
	
e110._alphaOut = function(e87,just){
	e110.e31(e87,1);
	}

e110.e31 = function(e87,alphaFactor){
	for(var n=0;n < e87.length;n++){
		if (e87[n][0]){
			e110.e31(e87[n],alphaFactor);
			}
			else{ e87[n].transform.getParam("diffuse").value = [
																 e87[n].red,
																 e87[n].green,
																 e87[n].blue,
																 alphaFactor*e87[n].alpha
																 ];
			}
		}
	}




e110.e116 = function(cubes){
	var fathers = new Array;
	var testCube;
	for (var nCubes=0;nCubes < cubes.length;nCubes++){
		var thisCube = cubes[nCubes];
		thisCube.clearRecord = true;
		var newFather = true;
		for (var nFather=0;nFather < fathers.length;nFather++){
			if(fathers[nFather]==thisCube.parent){
				newFather = false;
				}
			}
		if(newFather){
			fathers.push(thisCube.parent);
			}
		}
	var cubeSelectNowLength = e63.length;
	for(var nSelect=cubeSelectNowLength-1;nSelect>=0;nSelect--){
		if(!e63[nSelect][2][0]){
				testCube = e63[nSelect][2];
				if(testCube.clearRecord){
					e220.clearWireFrame(nSelect);
					e63.splice(nSelect,1);
					}
			}
		}
		
		
	for(var nFather=0;nFather < fathers.length;nFather++){
		var thisMass = fathers[nFather];
		var thisMassLength = thisMass.length
		for(var nCubes=thisMassLength-1;nCubes>=0;nCubes--){
			if(!thisMass[nCubes][0]){
				testCube = thisMass[nCubes];
				if(testCube.clearRecord){
					testCube.transform.parent = null;
					thisMass.splice(nCubes,1);
					e68[testCube.x][testCube.y][testCube.z] = null;
					}
				}
			}
		e110.e117(thisMass);
		}
	}

e110.e117 = function(thisMass){
	
		if(thisMass != e9){
			if(!thisMass[0]){
			thisMass.massClearRecord = true;
			var massFather = thisMass.parent;
				for(var nMass=0;nMass < massFather.length;nMass++){
					if (massFather[nMass].massClearRecord){
						massFather.splice(nMass,1);
						e62.pop();
						view.e92();
						e110.e31(e62[e62.length-1],1);
						e110.e117(massFather);
						break;
						}
					}
				}
			}	
	}

e110.e118 = function(thisMass){
	
		if(thisMass != e9){
			if(!thisMass[0]){
			thisMass.massClearRecord = true;
			var massFather = thisMass.parent;
				for(var nMass=0;nMass < massFather.length;nMass++){
					if (massFather[nMass].massClearRecord){
						massFather.splice(nMass,1);
						e62.pop();
						view.e92();
						e110.e31(e62[e62.length-1],1);
						e110.e118(massFather);
						break;
						}
					}
				}
				else{
					
					e110.e122(thisMass);
				}
			}	
	}



e110.e119 = function(){
	if(e63[0]){
		e220.e216();
		var cubeSelectNowLength = e63.length;
		 	for (var n=cubeSelectNowLength-1;n>=0;n--)
			  {
				 e110.e120(e62[e62.length-1][e63[n][0]]);
				 e62[e62.length-1].splice(e63[n][0],1);
			  }
			e63 = [];
			e110.e118(e62[e62.length-1]);
		 }
	}
	
e110.e120 = function(e87){
		if (e87[0])
		   {				 
		   e62.push(e87);
		   var massLength = e87.length;
		 	for (var n=massLength-1;n>=0;n--)
			    {
				 e110.e120(e87[n]);
				 e62[e62.length-1].splice(n,1);
				}			
				e62.pop();
			}
		else 
		{
			e87.transform.parent = null;
			e68[e87.x][e87.y][e87.z] = null;
		}
	}
	
e110.e121 = function(e87){
	
	e87.boundingBox = null;
	var bounding;
	if(e87[0]){
	for(var n=0;n < e87.length;n++){
		bounding = e110.e121(e87[n]);
		e87.boundingBox =  e87.boundingBox ? 
							e87.boundingBox.add(bounding):
							bounding;
			}
		}
		else{
			e87.comBounding();
			}
	return 	e87.boundingBox;
	}
	

e110.e122 = function(e87){
	
	if(e87 != e9){
		e87.boundingBox = e87[0].boundingBox
		for(var n=1;n < e87.length;n++){
			e87.boundingBox = e87.boundingBox.add(e87[n].boundingBox);
			}
		e110.e122(e87.parent);
		}
	}
	
e110.e123 = function(){
	var allExistArray = new Array;
	e220.e216();
	for (var n = 0;n < e62[e62.length-1].length;n++){
		allExistArray[n] = [];
		allExistArray[n][1] = [];
		allExistArray[n][3] = [];
		allExistArray[n][0]= n ;
		allExistArray[n][2] = e62[e62.length-1][n];
		allExistArray[n][4] = e62[e62.length-1][n];
		}
		e63 = allExistArray;
	}


e110.e124 = function(){
	if(e63[0]){
		var e87 = e62[e62.length-1];
		e110.e125(e87);
		e220.e216();
		var selectArray = new Array;
		selectArray[0] = e87.length-1;
		selectArray[1] = null;
		selectArray[2] = e87[e87.length-1];
		selectArray[3] = e63[e63.length-1][3];
		selectArray[4] = null;
		e63 = [];
		e63.push(selectArray);
		}
	}

e110.e125 = function(e87){
		var massPack = new Array;
		
		massPack.transform = e4.createObject("Transform");
		massPack.transform.parent = e87.transform;
		massPack.x = 0;
		massPack.y = 0;
		massPack.z = 0;
		massPack.localX = 0;
		massPack.localY = 0;
		massPack.localZ = 0;
		massPack.parent = e87;
		var num;
		var selectNum = e63.length;
		for(var n=0;n < selectNum;n++){
			massPack.push(e63[n][2]);
			e63[n][2].parent = massPack;
			e63[n][2].transform.parent = massPack.transform;
			massPack.boundingBox = massPack.boundingBox ? 
								massPack.boundingBox.add(e63[n][2].boundingBox):
								e63[n][2].boundingBox;
			}
		for(var n=selectNum-1;n>=0;n--){
			var selectInfo = e63[n];
			num = selectInfo[0];
			e87.splice(num,1);
			}
		e87.push(massPack);
	}
	
e110.e126 = function(){
	var e87 = e62[e62.length-1];
	e110.e127(e87);
	}

e110.e127 = function(e87){
	if (e63.length == 1 && e63[0][2][0]){
		var num = e63[0][0];
		var thisMass = e63[0][2];
		e220.clearWireFrame(0);
		e63 = [];
			var selectNum = thisMass.length;
			for(var n=0;n < selectNum;n++){
				thisMass[n].parent = e87;
				thisMass[n].transform.translate(thisMass.localX,
												thisMass.localY,
												thisMass.localZ);
				thisMass[n].transform.parent = e87.transform;
				thisMass[n].localX += thisMass.localX;
				thisMass[n].localY += thisMass.localY;
				thisMass[n].localZ += thisMass.localZ;
				e87.push(e87[num][n]);
				}
		e87.splice(num,1);
		}
	}



e110.e101 = function(){
	for(n=0;n < e63.length;n++){
		if(e63[n][2][0]){
			e110.e256(e63[n][2],
									e60.red,
									e60.green,
									e60.blue,
									e60.alpha)
		}
		else{
			e63[n][2].red = e60.red;
			e63[n][2].green = e60.green;
			e63[n][2].blue = e60.blue;
			e63[n][2].alpha = e60.alpha;
			e63[n][2].e221(e60.red,
											e60.green,
											e60.blue,
											e60.alpha);
			}
		}
	}

e110.e256 = function(e87,r,g,b,alpha){
	if(e87[0]){
		var massLength = e87.length;
		for(var n=0;n < massLength;n++){
			e110.e256(e87[n],r,g,b,alpha);
			}
		}
		else{
			e87.e221(r,g,b,alpha);
			}
	}





e110.e128 = function(e87,e33){
	var transform = e4.createObject("Transform");
	transform.parent = e1.root;
	transform.addShape(e48[2].planShape);
	var returnDirection = e33;
	var e87 = e87;
	if (returnDirection[4]||returnDirection[5]){
						if (Math.abs(e52[1]) < PI/18){
							transform.translate([e87.x-e87.l/2,0,0]);
							transform.scale([1,2048,2048]);
							transform.rotateY(PI/2);
							}
						else {
							transform.translate([0,e87.y+e87.l/2,0]);
							transform.scale([2048,1,2048]);
							transform.rotateX(PI/2);
							}
							}	
		else if(returnDirection[3]||returnDirection[2]) {
							if (Math.abs(e52[0]) > PI/4 && Math.abs(e52[0]) < 3*PI/4){
								transform.scale([2048,2048,1]);
								transform.translate([0,0,e87.z-e87.l/2]);
								}
							else{
								transform.scale([1,2048,2048]);
								transform.translate([e87.x-e87.l/2,0,0]);
								transform.rotateY(PI/2);
								}
					}
			else {
					     if (Math.abs(e52[1]) < PI/18){
							transform.translate([0,0,e87.z-e87.l/2]);
							transform.scale([2048,2048,1]);
							}
						else {
							transform.translate([0,e87.y-e87.l/2,0]);
							transform.scale([2048,1,2048]);
							transform.rotateX(-PI/2);
							}
				}
	var boundingBox = transform.shapes[0].elements[0].getBoundingBox(0).mul(transform.worldMatrix);
	transform.parent = null;
	return boundingBox;
	}
	
e110.e129 = function(){
	if(!e58["moveMode"]){
		e58["moveMode"] = true;
		e58["alphaTime"] = false;
		}
		else{
			e58["moveMode"] = false;
			e58["alphaTime"] = true;
			}
	}

e110.e257 = function(x,y,z,directionArray){
	var unSelected = true;
	e77(x,y);
	var testCube = e68[x][y][z];
	
	for(var n=0;n < e63.length;n++){
		if( e63[n][2]==testCube){
			e220.clearWireFrame(n);
			unSelected = false;
			for(var nDire=0;nDire < 6;nDire++){
				e63[n][3][nDire] = e63[n][3][nDire] || directionArray[nDire];
				}
			break;
			}
			
		}
	var num = e110.e32(testCube);
	if(unSelected && testCube && num!=undefined){
		var newSelected = [];
		newSelected[1] = [];
		newSelected[3] = directionArray;
		newSelected[0]= num;
		newSelected[2] = testCube;
		newSelected[4] = testCube;
		e63.push(newSelected);
		}
	}
e110.e32 = function(e87){
	var thisParent = e62[e62.length-1];
	for(var n=0;n < thisParent.length;n++){
		if(thisParent[n]==e87){
			var num = n;
			break;
			}
		}
	return num;
	}
var e130 = e130 || {};

 

e130.startDragging = function(E){
	e49[0] = e49[2] = E.x;
	e49[1] = e49[3] = E.y;	
	e49[4] = e49[10] = e52[0];
	e49[5] = e49[11] = e52[1];
	e49[6] = e53;
	e49[7] = e54[0];
	e49[8] = e54[1];
	e49[9] = e54[2];
	if(e15 == "NONE"){
		e1.cursor = e3.Cursor.NONE;
		}else if(e15 == "POINTER"){
			e1.cursor = e3.Cursor.POINTER;
			}else if(e15 == "MOVE"){
				e1.cursor = e3.Cursor.MOVE;
				}else{
					e1.cursor = e3.Cursor.DEFAULT;
					}
	
	if(E.button == 0 && e59 ){
		e58["leftButton"] = true;
		e64.e19 = [];
		
		e58["frameTouchStart"] = false;
		if(e64[0]){
			for (var n = e64.length-1;n>=0;n--){
				
				if(e58["frameTouchStart"]){break;}
				
				for (var nSub = e64[n].length-1;nSub>=0;nSub--){
					var testFrame = e64[n][nSub];
						if(E.x>testFrame.x && 
						   E.x-testFrame.x < testFrame.width &&
						   E.y>testFrame.y && 
						   E.y-testFrame.y < testFrame.height){
							e58["frameTouchStart"] = true;
							
							if(n != e64.length-1){
								e64.e226(n);
								if(nSub==e64[e64.length-1].length-1){
									
									e64[e64.length-1][nSub].e147([E.x,E.y])
									}
								}
							else if(nSub==e64[n].length-1){
								
								e64[n][nSub].e147([E.x,E.y])
								}
							break;
						}
					}
				}
 			}
		
		if (e99.length!=0){
				e104.e108(e10[e99[0]]);
				e10[e99[0]].transform.parent = null;
				e10[e99[0]].centerX = e10[e99[0]].centerY = undefined;		
				e99 = [];
			}
		else if(!e58["frameTouchStart"]){
				if(e58["moveMode"]){
					e70 = e78.e82(E);
					if (e70){
							 e71 = [0,0,0];
							 e220.e200();
							 e69 = e110.e128(e70[4],e70[3]);
							 }
							else{
								e110.e129();
								e220.e216();
								e63 = [];
								
								var pickJustNow = e78.e79(E);
								e74 = e78.e83(pickJustNow);
								e58["drawSelect"] = true;
								}
				}
				else if(e58["pickColorMode"]){
					var pickJustNow = e78.e80(E);
					e86(pickJustNow);
					
				}
				else if(e58["penMode"]){
					
					var pickJustNow = e78.e80(E);
					if(pickJustNow){
						
						pickJustNow[2].e221(e60.red,
												   e60.green,
												   e60.blue,
												   e60.alpha);
						e74 = e78.e83(pickJustNow);
						}
						else{
							var checkNum = e174.e170();
							if(checkNum != undefined){
								e58["penMode"] = false;
								e174.e169();
								
								e15="DEFAULT";
								e17.e139([0]);

								e132.e156(e174,-e174.width,0);
								e132.tips.hidden();
								}
							}
					}
					else{
						e70 = e78.e82(E);
						
						if(e70 && !e70[2][0] && e70[5]){
							e71 = [0,0,0];
							e220.e198();
							e69 = e110.e128(e70[4],e70[3]);
							}
						else if(e70 && e70[2][0]){
								
								e71 = [0,0,0];
								e220.e199();
								e69 = e110.e128(e70[4],e70[3]);
								}
								
						else {
							var pickJustNow = e78.e79(E);
							e74 = e78.e83(pickJustNow);
							e58["drawSelect"] = true;
							
							if(pickJustNow && !e58["firstDrawSelected"]){
								e132.tips.showBy("很好，你已经选中了一个面。下面我们来尝试创建出自己的方块。把鼠标放到刚被选中的面上，会有一个提示箭头。这时候左键点击这个面不要松开，沿着箭头提示的方向把它向外拉出来，新的方块就会长出来。试试看吧，奇迹就要诞生了！",800);
								e58["firstDrawSelected"] = true;
								}
							}
					}
				}
				
		}
		else if (E.button == 1){
			e58["move"] = true;
			}
		else if (E.button == 2){
			e58["rotation"] = true;
			}
	e18 = true;
	}

e130.drag = function(E){
		e49[2] = E.x;
		e49[3] = E.y;
		if(e15 == "NONE"){
			e1.cursor = e3.Cursor.NONE;
			
			
			e17.e138([E.x, E.y]);
			
			}else if(e15 == "POINTER"){
				e1.cursor = e3.Cursor.POINTER;
				}else if(e15 == "MOVE"){
					e1.cursor = e3.Cursor.MOVE;
					}else{
						e1.cursor = e3.Cursor.DEFAULT;
						}
		
			e58["frameTouchOver"] = false;
			if(!e18 && e64[0]){
			for (var n = e64.length-1;n>=0;n--){
					
					if(e58["frameTouchOver"]){break;}
					
					for (var nSub = e64[n].length-1;nSub>=0;nSub--){
						var testFrame = e64[n][nSub];
							if(E.x>testFrame.x && 
							   E.x-testFrame.x < testFrame.width &&
							   E.y>testFrame.y && 
							   E.y-testFrame.y < testFrame.height){
								e58["frameTouchOver"] = true;
								var touchFrameMassNum = n;
								if(nSub==e64[n].length-1){
								
									e64[n][nSub].e148([E.x,E.y]);
									}
								else{
								
									}
								break;
							}
							else{
								testFrame.e146();
								
								}
						}
					}
				}
				
			if(e58["leftButton"] && e64.e19[0]){
				for (var n = 0;n < e64.e19.length ;n++){
						e64.e19[n][0].e150([E.x,E.y,
																	   e64.e19[n][1],
																	   e64.e19[n][2]]);
					}
				}
			
		if (e99.length!=0 ){
			e104.e107(E,e99[0]);
			}
		else if(!e58["frameTouchOver"]){
			if (e58["move"]){
				e55 = null;
				var rY = (e49[3] - e49[1]) * e57 * e49[6] * 0.1;
				var aY = e49[4] - PI;
				var bY = PI/2 - e49[5];
				var rX = (e49[0] - e49[2]) * e57 * e49[6] * 0.1;
				var aX = e49[4] - PI/2;
				var targetZ = rY*Math.cos(bY)*Math.sin(aY) + rX*Math.sin(aX) + e49[9];
				var targetY = rY*Math.sin(bY) + e49[8];
				var targetX = rY*Math.cos(bY)*Math.cos(aY) + rX*Math.cos(aX) + e49[7];
				view.e88([targetX,targetY,targetZ]);
				}
				else if (e58["rotation"]){
					e55 = null;
					var angleAfter = new Array;
					angleAfter[0]  = (e49[2]-e49[0]) * e57 + e49[4];
					var angleTest =  (e49[3]-e49[1]) * e57 + e49[5];
					if (angleTest >= 0){
						angleAfter[1] = Math.abs(angleTest)>PI/2 - 0.001 ? PI/2 - 0.001: angleTest;
						}
						else{
							angleAfter[1] = Math.abs(angleTest)>PI/2 - 0.001 ? -PI/2 + 0.001: angleTest;
							}
					view.e89(angleAfter);
					}
					else if (e58["drawSelect"]){
						if(e74){
							e78.e84(e74,E);
							}
						}
						else if(e58["moveMode"]){
							if(e70){
								e220.e202(e70[4],e70[3],e69,E.x,E.y);
								e66.e264(e70,e71[0]);
								}
							else{
								var pickForDisplay = e78.e82(E);
								e130.e259(pickForDisplay);
								}
							}
						else if(e70 && !e70[2][0]){
							e220.e205(e70[4],e70[3],e69,E.x,E.y);
							e67.e264(e70,e71[1]);
							}
						else if(e70 && e70[2][0]){
							e220.e202(e70[4],e70[3],e69,E.x,E.y);
							e66.e264(e70,e71[0]);
							}
						else if(e58["penMode"] && E.button == 0 && e18){
							if(e74){
								e78.e85(e74,E);
								}
							}
						else if(!e70){
								var pickForDisplay = e78.e82(E);
								e130.e259(pickForDisplay);
								}
		}
	}

e130.stopDragging = function(E){
		e52[0] = view.PiRound(e52[0]);
		e52[1] = view.PiRound(e52[1]);
		e18 = false;
		e66.clear();
		if(e15 == "NONE"){
			e1.cursor = e3.Cursor.NONE;
			}else if(e15 == "POINTER"){
				e1.cursor = e3.Cursor.POINTER;
				}else if(e15 == "MOVE"){
					e1.cursor = e3.Cursor.MOVE;
					}else{
						e1.cursor = e3.Cursor.DEFAULT;
						}
		
		if (E.button == 0 && e59){
			e58["frameTouchStop"] = false;
			if(e64[0]){
			for (var n = e64.length-1;n>=0;n--){
					
					if(e58["frameTouchStop"]){break;}
					
					for (var nSub = e64[n].length-1;nSub>=0;nSub--){
						var testFrame = e64[n][nSub];
							if(E.x>testFrame.x && 
							   E.x-testFrame.x < testFrame.width &&
							   E.y>testFrame.y && 
							   E.y-testFrame.y < testFrame.height){
								e58["frameTouchStop"] = true;
								var touchFrameMassNum = n;
								if(nSub==e64[n].length-1){
								
									e64[n][nSub].e149([E.x,E.y])
									}
								else{
								
									}
								break;
							}
						}
					}
				}
	
			if((!e58["frameTouchStop"] && !e58["frameTouchStart"])||
				(e58["frameTouchStop"] && (e58["growth"]||e58["moved"]))){
					if (e58["growth"]){
						e220.e208();
							
						e220.e216();
						e63 = [];
						var thisMass = e62[e62.length-1];
						var nNum = thisMass.length;
						for(var nCube=0;nCube < nNum;nCube++){
							if(!thisMass[nCube].boundingBox){
								thisMass[nCube].comBounding();
								}
							}
						e110.e122(e62[e62.length-1]);
						
						
						
							if(e58["growth"] && !e58["firstGrowthed"]){
								e132.tips.showBy("就是这样，接下来请自己尝试更多的操作，还有更多的奇迹等待你来实现！开始分享和发掘你的想象力吧。",400);
								e58["firstGrowthed"] = true;
								}
								
								
						e58["growth"] = false; 
						}
					else if (e58["moved"]){
							e220.e204(e73[0],e70[3]);
							
							e220.e216();
							e63 = [];
							for(var nMass=e73[0].length-1;nMass>=0;nMass--){
								
								e110.e121(e73[0][nMass]);
								}
						e110.e122(e62[e62.length-1]);
						e58["moved"] = false;
						}
					else if(!e58["drawSelect"] && !e58["penMode"]){
							e78.e79(E);
						}
					e70 = null;
					}
				}
		else if (E.button == 2){
					e104.cancel();
					if (e99.length ==0 && 
						Math.abs(e49[0]-E.x) < 3 && 
						Math.abs(e49[1]-E.y) < 3 && e59){
						var menuNo;
						if(e63.length == 0){
							menuNo = 0;
							}
						else{
							var e228 = e78.e82(E);
							if (!e228){menuNo = 1;}
							else{
								var massExist = false;
								var cubeExist = false;
								for(var n=0;n < e63.length;n++){
									if(e63[n][2][0]){massExist = true;}
									else{cubeExist = true;}
									}
								if(massExist && !cubeExist){menuNo = 2;}
								else if(!massExist && cubeExist){menuNo = 3;}
								else if(!e228[2][0]){menuNo = 3;}
								else {menuNo = 4;}
								}
							}
				e10[menuNo].transform.parent = e10.transform;
				e104.e107(E,menuNo);
				}
			}
		
		e58["leftButton"] = false;
		e58["zoom"] = false;
		e58["move"] = false;
		e58["rotation"] = false;
		e58["drawSelect"] = false;
		e58["directMove"] = false;
		e58["picking"] = false;
		e58["zoomfalse"] = false;
		
	}

e130.e258 = function(E){
	
	e66.clear();
	e67.clear();

	if(!e58["zoomfalse"]){
			e58["zoomfalse"] = true;
			var zoom = (E.deltaY>0) ? 1/e56 : e56;
			view.e90(e53*zoom,15);
			e55 = null;
		}
	}


e130.e259 = function(e228){
	if(e228){
		if(e58["moveMode"]){
			e66.e265(e228,true);
			e67.clear();
			}
		else if(e228[2][0]){
			e66.e265(e228);
			e67.clear();
			}
		else if(e228[5]){
			e67.e265(e228);
			e66.clear();
			}
		else{
			e66.clear();
			e67.clear();
			}
		}
	else{
		e66.clear();
		e67.clear();
		}
	}	

e130.keyDown = function(E){
		
		if(E.ctrlKey){
			switch(E.keyCode){
				case 65:
					e110.e123();
					e104.cancel();
					break;
				case 83:
					document.getElementById("dataForm").cubeData.value = 
											e110.e111(e62[e62.length-1]);
					e104.cancel();
					break;
				}
		}	
		else{	
			switch(E.keyCode){
				case 80:
					e110.e115();
					setTimeout(function(){resizeClient();},50);
					break;
				case 76:
					saveCapToServer()
					break;
				case 32: 
					view.e92();
					e104.cancel();
					break;
				case 90:
					 undoCube();
					 e104.cancel();
					break;
				case 82:
					e220.e206();
					e104.cancel();
					break;
				case 77:
					e110.e129();
					e104.cancel();
					break;
				case 79:
					
					break;
				case 46:
					e110.e119();
					e104.cancel();
					break;
				case 71:
					e110.e124();
					e104.cancel();
					break;
				case 85:
					e110.e126();
					e104.cancel();
					break;
				case 80:
					if(!e58["penMode"]){
						e58["penMode"] = true;
						
						}
						else{
							e58["penMode"] = false;
							}
					break;
				case 67:
					e110.e101();
					e104.cancel();
					break;
				case 38:
					e100.e248();
					break;
				case 37:
					e100.e250();
					break;
				case 40:
					e100.e249();
					break;
				case 39:
					e100.e251();
					break;
				case 229:
					e132.tips.showBy("是不是把输入法打开了？",500);
				break;
				}
			}
			
			
		if(E.altKey){
			if(E.keyCode != 18){
				alert(E.keyCode);
				}
			}

	}


e130.e131 = function(E){
			e58["frameTouchDouble"] = false;
			if(e64[0]){
				for (var n = 0;n < e64.length ;n++){
					
					if(e58["frameTouchDouble"]){break;}
					
					for (var nSub = e64[n].length-1;nSub>=0;nSub--){
						var testFrame = e64[n][nSub];
							if(E.x>testFrame.x && 
							   E.x-testFrame.x < testFrame.width &&
							   E.y>testFrame.y && 
							   E.y-testFrame.y < testFrame.height){
								e58["frameTouchDouble"] = true;
								var touchFrameMassNum = n;
								if(nSub==e64[n].length-1){
								
									
									}
								else{
								
									}
								break;
							}
						}
					}
				}

	if(!e58["frameTouchDouble"]){
		var deltaX = Math.abs(E.x - e49[0]);
		var deltaY = Math.abs(E.y - e49[1]);
		if (deltaX < 3 && deltaY < 3){
				e220.e216();
				e63 = [] ;
				e78.e79(E);
				var selectArea = e62[e62.length-1];
				if(!e63[0]){
					if(e62.length!=1){
						var just = e62.pop();
						e110.e30(e62[e62.length-1],0.1,just);
						}
					e220.e216();
					e63 = [];
					view.e92();
					return;
					}
				
				if(e63[0][2][0]){
					e62.push(e63[0][2]);	
					e110.e30(e62[e62.length-1],0.1);
					e220.e216();
					e63 = [];
					view.e92();
					}
					else{
						view.e93();
						}
			}
		}
	}



var e132 = e132 || {};

e132.e98 = function(name,text,e235,e236,e237,e238){
	this.name = name;
	this.child = new Array;
	this.x = 0;
	this.y = 0;
	this.z = e238 == undefined ? 0 : e238;
	
	this.textContent = text[0];
	this.textCoordinateX = text[1] ? text[1] : 0;
	this.textCoordinateY = text[2] ? text[2] : 0;
	this.textTypeface = text[3] ? text[3] : "Microsoft YaHei";
	this.textSize = text[4] ? text[4] : 10;
	this.textColor = text[5] ? text[5] : [0,0,0,1];
	this.e245 = text[6] ? text[6] : 99999999;
	
	this.bgImageTexture = e235[0];
	this.e241 = e235[1] != undefined ? e235[1] : 1;
	this.e239 = e235[2];
	this.e240 = e235[3];
	
	this.e236 = e236[0];
	this.e243 = e236[1];
	this.e244 = e236[2];
	this.e242 = e236[3];
	
	this.activating = true;
	
	if(e237["activeDown"]){
		this.activeDown = e237["activeDown"];
		}
		else{
			this.activeDown = function(){};
			}
			
	if(e237["activeOver"]){
		this.activeOver = e237["activeOver"];
		}
		else{
			this.activeOver = function(){};
			}
			
	if(e237["activeUp"]){
		this.activeUp = e237["activeUp"];
		}
		else{
			this.activeUp = function(){};
			}
	if(e237["activeDrag"]){
		this.activeDrag = e237["activeDrag"];
		}
		else{
			this.activeDrag = function(){};
			}
	if(e237["activeLeave"]){
		this.activeLeave = e237["activeLeave"];
		}
		else{
			this.activeLeave = function(){};
			}
	
	if(e237["defultFunction"]){
		this.defultFunction = e237["defultFunction"];
		}
		else{
			this.defultFunction = function(){};
		}
			
	this.transform = e4.createObject("Transform");
	this.transform.parent = e10.transform;
	this.e246 = e4.createObject("Transform");
	this.e246.parent = this.transform;
	
	this.transform.translate(0,0,this.z);
	
	if(this.bgImageTexture){
		this.e247 = e4.createObject("Transform");
		this.e247.parent = this.e246;
		
		this.bgImageTransform = e4.createObject("Transform");
		this.bgImageTransform.parent = this.e247;
		
		this.bgImageSampler = e4.createObject('Sampler');
		this.bgImageSampler.addressModeU = e3.Sampler.CLAMP;
		this.bgImageSampler.addressModeV = e3.Sampler.CLAMP;
		
		this.bgImageParamSampler = this.bgImageTransform.createParam('texSampler0',
														'ParamSampler');
		this.bgImageParamSampler.value = this.bgImageSampler;
		this.bgImageParamColorMult = this.bgImageTransform.createParam('colorMult',
														'ParamFloat4');
		
		this.bgImageParamColorMult.set(1, 1, 1, this.e241);
		
		this.bgImageSampler.texture = this.bgImageTexture;
		this.bgImageTransform.addShape(e48[3]);	
		
			if(this.e239 && this.e240){
				this.width = this.e239;
				this.height = this.e240;
				}
			else{
				this.width = this.bgImageTexture.width;
				this.height = this.bgImageTexture.height;
				}
		this.bgImageTransform.translate(this.width/2,this.height/2,0);
		this.bgImageTransform.scale(this.width,-this.height,1);
		
		
		}
		else if(this.e236  && this.e236[0] != undefined){
			this.width = this.e243;
			this.height = this.e244;
			
			this.e247 = e4.createObject("Transform");
			this.e247.parent = this.e246;
			
			this.bgImageTransform = e4.createObject("Transform");
			this.bgImageTransform.parent = this.e247;
			
			this.bgColorTexture = e4.createTexture2D(
														 this.width,
														 this.height,
														 o3djs.base.o3d.Texture.ARGB8,
														 1,
														 false);
			
			var linearPaint = e4.createObject('CanvasPaint');

			
			this.bgImageCanvas = e4.createObject("Canvas");
			this.bgImageCanvas.setSize(this.width,this.height);
			
			if(this.e236[1][0] != undefined){
				this.bgImageCanvas.clear([0,0,0,0]);
				var gradientShader = e4.createObject("CanvasLinearGradient");
				switch(this.e242){
					case "leftToRight":
						gradientShader.startPoint = [-1, 0];
						gradientShader.endPoint = [this.width-1, 0];
						break;
					case "rightToLeft":
						gradientShader.startPoint = [this.width-1, 0];
						gradientShader.endPoint = [-1, 0];
						break;
					case "downToUp":
						gradientShader.startPoint = [0, this.height-1];
						gradientShader.endPoint = [0, -1];
						break;
					case "upToDown":
						gradientShader.startPoint = [0, 0];
						gradientShader.endPoint = [0, this.height];
						break;
					default :
						gradientShader.startPoint = [0, 0];
						gradientShader.endPoint = [this.width, 0];
						break;
					}
					gradientShader.colors = this.e236;
					gradientShader.positions = [];
					gradientShader.tileMode = e3.CanvasShader.REPEAT;
				linearPaint.shader = gradientShader;
				this.bgImageCanvas.drawRect(0,0,this.width,this.height, linearPaint);
				}
			else{
				this.bgImageCanvas.clear(this.e236);
				}
			this.bgColorTexture.drawImage(this.bgImageCanvas,0,this.height-1,this.width,-this.height,
									   0,0,0,this.width,this.height
									   );
			this.bgImageSampler = e4.createObject('Sampler');
			this.bgImageSampler.addressModeU = e3.Sampler.CLAMP;
			this.bgImageSampler.addressModeV = e3.Sampler.CLAMP;
			
			this.bgImageParamSampler = this.bgImageTransform.createParam('texSampler0',
															'ParamSampler');
			this.bgImageParamSampler.value = this.bgImageSampler;
			this.bgImageParamColorMult = this.bgImageTransform.createParam('colorMult',
															'ParamFloat4');
			this.bgImageParamColorMult.set(1, 1, 1, 1);
				
			this.bgImageSampler.texture = this.bgColorTexture;
			this.bgImageTransform.addShape(e48[3]);	
			
			this.bgImageTransform.translate(this.width/2,this.height/2,0);
			this.bgImageTransform.scale(this.width,-this.height,1);
			
			}
			else if(this.e236 == undefined){
				this.width = this.e243;
				this.height = this.e244;
				}
	
	if(this.textContent){
		this.textMoveTransform = e4.createObject("Transform");
		this.textMoveTransform.parent = this.e246;
		
		this.textTransform = e4.createObject("Transform");
		this.textTransform.parent = this.textMoveTransform;
		
		
		this.textPaint = e4.createObject("CanvasPaint");
		this.textPaint.color = this.textColor;
		this.textPaint.textSize = this.textSize;
		this.textPaint.textTypeface = this.textTypeface;
		var fontBox = this.textPaint.measureText(this.textContent);
		this.textWidth = fontBox[2]-fontBox[0];
		this.textHeight = fontBox[3]-fontBox[1];
		
			if(this.textWidth>this.e245){
				
				var writeInRows = true;
				var splitText = e132.e133(this.textPaint,this.textContent,this.e245);
				fontBox = this.textPaint.measureText(splitText[0]);
				this.textWidth = this.e245;
				this.textHeight = (fontBox[3]-fontBox[1]+3)*splitText.length;
				}
		
		if (this.textHeight%2 != 0){this.textHeight = this.textHeight +1;}
		if (this.textWidth %2 != 0){this.textWidth = this.textWidth +1;}
		
		this.textTexture = e4.createTexture2D(
													 this.textWidth,
													 this.textHeight,
													 o3djs.base.o3d.Texture.ARGB8,
													 1,
													 false);
		this.textCanvas = e4.createObject("Canvas");
		this.textCanvas.setSize(this.textWidth,this.textHeight);
		this.textCanvas.clear([1,1,1,0]);
		this.textTexture.drawImage(this.textCanvas,0,this.textHeight-1,this.textWidth,-this.textHeight,
								   0,0,0,this.textWidth,this.textHeight
								   );
		
			if(writeInRows){
				for(var nRows=0;nRows < splitText.length;nRows++){
					this.textCanvas.drawText(splitText[nRows],
										 -fontBox[0],
										 (fontBox[3]-fontBox[1])*(nRows+1)-fontBox[3]+nRows*3,
										 this.textPaint);
					}
				}
			else{
				this.textCanvas.drawText(this.textContent,
									 -fontBox[0],
									 this.textHeight-fontBox[3],
									 this.textPaint);
				}
		
		this.textTexture.drawImage(this.textCanvas,0,this.textHeight-1,this.textWidth,-this.textHeight,
								   0,0,0,this.textWidth,this.textHeight
								   );
		this.textSampler = e4.createObject('Sampler');
		this.textSampler.addressModeU = e3.Sampler.CLAMP;
		this.textSampler.addressModeV = e3.Sampler.CLAMP;
		
		this.textParamSampler = this.textTransform.createParam('texSampler0',
														'ParamSampler');
		this.textParamSampler.value = this.textSampler;
		this.textParamColorMult = this.textTransform.createParam('colorMult',
														'ParamFloat4');
		
		this.textParamColorMult.set(1, 1, 1, 1);
		
		this.textSampler.texture = this.textTexture;
		this.textTransform.addShape(e48[3]);	
		
		this.textTransform.translate(this.textWidth/2,this.textHeight/2,0.001);
		this.textTransform.scale(this.textWidth,-this.textHeight,1);
		
		if (!this.width){
			this.width = this.textWidth;
		}
		if (!this.height){
			this.height = this.textHeight;
 			}
		
		if (this.textCoordinateX  == "left"){
			this.textMoveTransform.translate(3,0,0);
			}else if (this.textCoordinateX  == "center"){
				this.textMoveTransform.translate(Math.round((this.width - this.textWidth - 3)/2),0,0);
				}else if(this.textCoordinateX  == "right"){
					this.textMoveTransform.translate(this.width - this.textWidth,0,0);
					}else {
						this.textMoveTransform.translate(this.textCoordinateX,0,0);
						}
		if (this.textCoordinateY  == "top"){
			this.textMoveTransform.translate(0,3,0);
			}else if (this.textCoordinateY  == "middle"){
				this.textMoveTransform.translate(0,Math.round((this.height - this.textHeight)/2),0);
				}else if(this.textCoordinateY  == "bottom"){
					this.textMoveTransform.translate(0,this.height - this.textHeight - 3,0);
					}else{
						this.textMoveTransform.translate(0,this.textCoordinateY,0);
						}
		}
	}
	
e132.e133 = function(textPaint,text,width){
	var textString;
	var splitTextArray = [];
	var splitNum = 0;
	var subSplitNum;
	for(var n=0;splitNum < text.length;n++){
		textString = text.slice(splitNum);
		
		subSplitNum = e132.e134(textPaint,textString,width);
		splitNum += subSplitNum;
		
		splitTextArray[n] = textString.slice(0,subSplitNum);
		}
	return splitTextArray;
	}
	
e132.e134 = function(textPaint,text,width){
	
	var textString = text;
	var splitString; 
	var fontBox;
	var textWidth = 0;
	for(var n=0;textWidth < width && (n-2) < text.length;n++){
		splitString = textString.slice(0,n)
		fontBox = textPaint.measureText(splitString);
		textWidth = fontBox[2]-fontBox[0];
		}
	n--;
	n--;
	return n;
	} 	

e132.e98.prototype.e135 = function(Param){
	var texture = Param[0];
	
	this.bgImageTexture = texture;
	this.bgImageSampler.texture = this.bgImageTexture;
	}

e132.e98.prototype.e136 = function(Param){
	var colorRed = Param[0] == undefined?  this.e236[0] :Param[0];
	var colorBlue = Param[1] == undefined?this.e236[1]: Param[1] ;
	var colorGreen = Param[2] == undefined? this.e236[2]:Param[2];
	var colorAlpha = Param[3] == undefined ? this.e236[3]:Param[3];
	
	this.e236 =[colorRed,colorBlue,colorGreen,colorAlpha]; 
	
	this.bgImageCanvas.clear(this.e236);
	this.bgColorTexture.drawImage(this.bgImageCanvas,0,this.height-1,this.width,-this.height,
							   0,0,0,this.width,this.height
							   );
	
	}

e132.e98.prototype.e137 = function(Param){
	this.e246.identity();
	this.e246.scale(Param[0],Param[0],1);
	}


e132.e98.prototype.e138 = function(Param){
	this.x = Param[0];
	this.y = Param[1];
	this.transform.identity();
	this.transform.translate(Param[0],Param[1],this.z);
	
	}

e132.e98.prototype.e139 = function(Param){
	var alpha = Param[0];
	
	if(this.textTransform){
		this.textParamColorMult.set(1, 1, 1, alpha);
		}
	if(this.bgImageTransform){
		this.bgImageParamColorMult.set(1, 1, 1, alpha);
		}
	
	for(var n=0;n < this.child.length;n++){
		this.child[n].e139([alpha])
		}
	}
	
e132.e98.prototype.e140 = function(Param){
	var alpha = Param[0];
	
	if(this.textTransform){
		this.textParamColorMult.set(1, 1, 1, alpha);
		}
	}
	
e132.e98.prototype.e141 = function(Param){
	var alpha = Param[0];
	
	if(this.bgImageTransform){   
		this.bgImageParamColorMult.set(1, 1, 1, alpha);
		}
	}

e132.e98.prototype.e142 = function(Param){
	var newContent = Param[0];
	var newTypeface = Param[1];
	var newSize = Param[2];
	var newColor = Param[3];
	var newCoordinateX = Param[4];
	var newCoordinateY = Param[5];
	var e245 = Param[6];
	
		if(newContent){
			this.textContent = newContent; 
			}
		if(newTypeface){
			this.textTypeface = newTypeface; 
			}
		if(newSize){
			this.textSize = newSize; 
			}
		if(newColor){
			this.textColor = newColor; 
			}
		if(newCoordinateX){
			this.textCoordinateX = newCoordinateX;
			}
		if(newCoordinateY){
			this.textCoordinateY = newCoordinateY;
			}
		if(e245){
			this.e245 = e245;
			}
		
		this.textPaint.color = this.textColor;
		this.textPaint.textSize = this.textSize;
		this.textPaint.textTypeface = this.textTypeface;
		
		var fontBox = this.textPaint.measureText(this.textContent);
		this.textWidth = fontBox[2]-fontBox[0];
		this.textHeight = fontBox[3]-fontBox[1];
		
			if(this.textWidth>this.e245){
				
				var writeInRows = true;
				var splitText = e132.e133(this.textPaint,this.textContent,this.e245);
				fontBox = this.textPaint.measureText(splitText[0]);
				this.textWidth = this.e245;
				this.textHeight = (fontBox[3]-fontBox[1]+3)*splitText.length;
				}
		
		
		if (this.textHeight%2 != 0){this.textHeight = this.textHeight +1;}
		if (this.textWidth %2 != 0){this.textWidth = this.textWidth +1;}
		e4.removeObject(this.textTexture);
		this.textTexture = e4.createTexture2D(
													 this.textWidth,
													 this.textHeight,
													 o3djs.base.o3d.Texture.ARGB8,
													 1,
													 false);
		this.textCanvas.setSize(this.textWidth,this.textHeight);
		this.textCanvas.clear([1,1,1,0]);
		this.textTexture.drawImage(this.textCanvas,0,this.textHeight-1,this.textWidth,-this.textHeight,
								   0,0,0,this.textWidth,this.textHeight
								   );
		
			if(writeInRows){
				for(var nRows=0;nRows < splitText.length;nRows++){
					this.textCanvas.drawText(splitText[nRows],
										 -fontBox[0],
										 (fontBox[3]-fontBox[1])*(nRows+1)-fontBox[3]+nRows*3,
										 this.textPaint);
					}
				}
			else{
				this.textCanvas.drawText(this.textContent,
									 -fontBox[0],
									 this.textHeight-fontBox[3],
									 this.textPaint);
				}
		this.textTexture.drawImage(this.textCanvas,0,this.textHeight-1,this.textWidth,-this.textHeight,
								   0,0,0,this.textWidth,this.textHeight
								   );
		this.textSampler.texture = this.textTexture;
		this.textParamColorMult.set(1, 1, 1, 1);
		this.textTransform.identity();
		this.textTransform.translate(this.textWidth/2,this.textHeight/2,0.001);
		this.textTransform.scale(this.textWidth,-this.textHeight,1);
		this.textMoveTransform.identity();
		
		if (this.textCoordinateX  == "left"){
			this.textMoveTransform.translate(3,0,0);
			}else if (this.textCoordinateX  == "center"){
				this.textMoveTransform.translate(Math.round((this.width - this.textWidth - 3)/2),0,0);
				}else if(this.textCoordinateX  == "right"){
					this.textMoveTransform.translate(this.width - this.textWidth,0,0);
					}else {
						this.textMoveTransform.translate(this.textCoordinateX,0,0);
						}
		if (this.textCoordinateY  == "top"){
			this.textMoveTransform.translate(0,3,0);
			}else if (this.textCoordinateY  == "middle"){
				this.textMoveTransform.translate(0,Math.round((this.height - this.textHeight)/2),0);
				}else if(this.textCoordinateY  == "bottom"){
					this.textMoveTransform.translate(0,this.height - this.textHeight - 3,0);
					}else{
						this.textMoveTransform.translate(0,this.textCoordinateY,0);
						}
	}
		
e132.e98.prototype.e143 = function(Param){
	var newX = Param[0];
	var newY = Param[1];
	
	this.textCoordinateX = newX;
	this.textCoordinateY = newY;
	this.textMoveTransform.identity();
	this.textMoveTransform.translate(this.textCoordinateX,this.textCoordinateY,0.001);
	}
	

e132.e98.prototype.e144 = function(Param){
	var newChild = Param[0];
	var childX = Param[1] == undefined ? 0 : Param[1];
	var childY = Param[2] == undefined ? 0 : Param[2];
	var e238 = Param[3] == undefined ? this.z+1+this.child.length/100 : Param[2];
	newChild.transform.parent = this.e246;
	newChild.parent = this;
	this.child.push(newChild);
	newChild.transform.identity();
	newChild.transform.translate(childX,childY,e238);
	newChild.x = childX;
	newChild.y = childY;
	newChild.z = e238;
	}
	
e132.e98.prototype.e145 = function(){
	for(var n=0;n < this.parent.child.length;n++){
		if(this.parent.child[n]==this){
			var thisNum = n;
			}
		}
	this.parent.child.splice(thisNum,1);
	this.transform.parent = e10.transform;
	this.transform.identity();
	this.parent = null;
	this.x = 0;
	this.y = 0;
	this.z = 0;
	}

e132.e98.prototype.e146 = function(Param){
	
	this.activeLeave();
	if(this.child[0]){
		for(var n=0;n < this.child.length;n++){
			this.child[n].e146();
			}
		}
	}

e132.e98.prototype.changeZ = function(Param){
	var newZ = Param[0];
	this.z = newZ;
	this.transform.identity();
	this.transform.translate(this.x,this.y,newZ);
	}
	
e132.e98.prototype.e147 = function(Param){
	var downX = Param[0];
	var downY = Param[1];
	
		if(downX>this.x && 
		   downX-this.x < this.width &&
		   downY>this.y && 
		   downY-this.y < this.height){
				var childDownX = downX-this.x;
				var childDownY = downY-this.y;
				if (this.activating){
					this.activeDown([childDownX,childDownY]);
					e64.e19.push([this,childDownX,childDownY]);
					}
				for(var n=0;n < this.child.length;n++){
					this.child[n].e147([childDownX,childDownY]);
					}
			} 
	}           
	
e132.e98.prototype.e148 = function(Param){
	var downX = Param[0];
	var downY = Param[1];
	if(downX>this.x && 
	   downX-this.x < this.width &&
	   downY>this.y && 
	   downY-this.y < this.height){
			var childDownX = downX-this.x;
			var childDownY = downY-this.y;
			if (this.activating){
			this.activeOver([childDownX,childDownY]);
			}else {
			
				}
			for(var n=0;n < this.child.length;n++){
				this.child[n].e148([childDownX,childDownY]);
				}
		}
		else{
			this.e146();
			}
	}                

e132.e98.prototype.e149 = function(Param){
	var downX = Param[0];
	var downY = Param[1];
	
	if(downX>this.x && 
	   downX-this.x < this.width &&
	   downY>this.y && 
	   downY-this.y < this.height){
			var childDownX = downX-this.x;
			var childDownY = downY-this.y;
			if(this.activating){
			this.activeUp([childDownX,childDownY]);
			}else{
				
				
				}
			for(var n=0;n < this.child.length;n++){
				this.child[n].e149([childDownX,childDownY]);
				}
			}
	}                

e132.e98.prototype.e150 = function(Param){
			var upOne = this;
			for(var downX = Param[0],downY = Param[1];
				upOne;
				upOne = upOne.parent){
										downX = downX-upOne.x;
										downY = downY-upOne.y;
										}
			this.activeDrag([downX,downY,Param[2],Param[3]]);
	}       
	

e132.e98.prototype.e151 = function(childName,e107){
	
	for (var n=0;n < this.child.length;n++){
		if(this.child[n].child){
			this.child[n].e151(childName,e107);
			}
		if (this.child[n].name == childName){
			switch (e107[0]){
				case  "e138":
					this.child[n].e138(e107[1]);
					break;
				case "e135":
					this.child[n].e135(e107[1]);
					break;
				case "e136" :
					this.child[n].e136(e107[1]);
					break;
				case "e139" :
					this.child[n].e139(e107[1]);
					break;
				case "e140":
					this.child[n].e140(e107[1]);
					break;
				case "e141":
					this.child[n].e141(e107[1]);
					break;
				case "e144":
					this.child[n].e144(e107[1]);
					break;
				case "e142":
					this.child[n].e142(e107[1]);
					break;
				case "e154":
					this.child[n].e154();
					break;
				case "e153":
					this.child[n].e153();
					break;
				case "e137" :
					this.child[n].e137(e107[1]);
					break;
			}
		}
	}
	}
 


e132.e98.prototype.e152 = function(){
	this.x = e49[2] - e49[0] + this.x;
	this.y = e49[3] - e49[1] + this.y;
	this.e138([this.x,this.y]);
	}


e132.e98.prototype.e153 = function (){
 for(var n = 0;n < this.child.length;n++){
	 this.child[n].e153();
	 }
	 this.activating = false;
	}

e132.e98.prototype.e154 = function(){
	for(var n = 0;n < this.child.length;n++){
		this.child[n].e154();
		}
		this.activating = true;
	}
	
e132.e98.prototype.warnEffect = function(){
	clearInterval(e13);
	var e232 = 20;
	var step = 0;
	this.e139([0.2]);
	this.e137([0.8]);
	var thisFrame = this;
	e13 = setInterval(function(){e132._frameWarnEffect(thisFrame,e232,step);step++;},10);
	}

e132._frameWarnEffect = function(e98,e232,step){
	e98.e139([Math.sin(step/e232*PI/2)*0.8 + 0.8]);
	e98.e137([Math.sin(step/e232*PI/2)*0.2 + 0.8]);
	if (step>=e232){
		clearInterval(e13);
		e13 = null;
		}
	}

	
	
	

e132.e98.prototype.e155 = function(checkName){
	for(var n=0;n < this.child.length;n++){
		if(this.child[n].name == checkName){
			return this.child[n];
			}
		var founded = this.child[n].e155(checkName);
		if(founded){
			return founded;
			}
		}
	}
	
	

e132.e156 = function(thisDialog,x,y,e232){
	if(thisDialog.e11){
		clearInterval(e13[thisDialog.moveTimeNum]);
		e13[thisDialog.moveTimeNum] = null;
		thisDialog.e11 = null;
		thisDialog.moveTimeNum = null;
		}
	var availTimeNum;
	var newArray = true;
	for(var n=0;n < e13.length;n++){
		if(!e13[n]){
			availTimeNum = n;
			newArray = false;
			break;
			}
		}
	if(newArray){
		availTimeNum = e13.length;
		}
	var n = 0;
	var e232 = !e232 ? 15 : e232;
	var before = [thisDialog.x,thisDialog.y];
	var xL = x-thisDialog.x;
	var yL = y-thisDialog.y;
	e13[availTimeNum] = setInterval(function(){e132._moveSteps(availTimeNum,
																		   thisDialog,before,
																		   xL,yL,n,e232);n++;},10);
	
	thisDialog.e11 = e13[availTimeNum];
	thisDialog.moveTimeNum = availTimeNum;
	}
	
e132._moveSteps = function(availTimeNum,thisDialog,before,xL,yL,n,e232){
	var afterX = before[0]+xL*Math.sin(n*PI/2/e232);
	thisDialog.x = afterX;
	var afterY = before[1]+yL*Math.sin(n*PI/2/e232);
	thisDialog.y = afterY;
	thisDialog.transform.identity();
	thisDialog.transform.translate(afterX,afterY,thisDialog.z);
	if (n>=e232){
		clearInterval(e13[availTimeNum]);
		e13[availTimeNum] = null;
		thisDialog.e11 = null;
		thisDialog.moveTimeNum = null;
		}
	}
	
	
	
e132.e157 = function(thatDialog){
	if(thatDialog.child[0]){
		for(var n=0;n < thatDialog.child.length;n++){
			e132.e157(thatDialog.child[n]);
			}
		}
	thatDialog.transform.parent = null;
	thatDialog.e246.parent = null;
	e4.removeObject(thatDialog.transform);
	e4.removeObject(thatDialog.e246);
		if(thatDialog.bgImageTexture){
			e4.removeObject(thatDialog.e247);
			e4.removeObject(thatDialog.bgImageTransform);
			e4.removeObject(thatDialog.bgImageSampler);
			}
		if(thatDialog.bgColorTexture){
			e4.removeObject(thatDialog.e247);
			e4.removeObject(thatDialog.bgImageTransform);
			e4.removeObject(thatDialog.bgColorTexture);
			e4.removeObject(thatDialog.bgImageCanvas);
			e4.removeObject(thatDialog.bgImageSampler);
			}
		if(thatDialog.textTexture){
			e4.removeObject(thatDialog.textMoveTransform);
			e4.removeObject(thatDialog.textTransform);
			e4.removeObject(thatDialog.textPaint);
			e4.removeObject(thatDialog.textTexture);
			e4.removeObject(thatDialog.textCanvas);
			e4.removeObject(thatDialog.textSampler);
			}
	thatDialog = null;
}

e132.e158 = function(thisDialog,alphaBefore,alphaAfter,e232,afterAction){
	var afterAction = !afterAction ? function(){} : afterAction;
	
	if(thisDialog.alphaTime){
		clearInterval(e14[thisDialog.alphaTimeNum]);
		e14[thisDialog.alphaTimeNum] = null;
		thisDialog.alphaTime = null;
		thisDialog.alphaTimeNum = null;
		}
	var availTimeNum;
	var newArray = true;
	for(var n=0;n < e14.length;n++){
		if(!e14[n]){
			availTimeNum = n;
			newArray = false;
			break;
			}
		}
	if(newArray){
		availTimeNum = e14.length;
		}
		var n = 0;
		var e232 = !e232 ? 20 : e232;
		var alpha = !alpha ? 1 : alpha;
		var alphaL = alphaAfter-alphaBefore;
		e14[availTimeNum] = setInterval(function(){
										e132._alphaShowSteps(availTimeNum,thisDialog,alphaBefore,
															   alphaL,n,e232,afterAction);
										n++;
										},
										10);
		thisDialog.alphaTime = e14[availTimeNum];
		thisDialog.alphaTimeNum = availTimeNum;
	}
	
e132._alphaShowSteps = function(availTimeNum,thisDialog,alphaBefore,alphaL,n,e232,afterAction){
	var alphaNow = alphaBefore+alphaL*Math.sin(n*PI/2/e232); 
	thisDialog.e139([alphaNow]);
	if (n>=e232){
		clearInterval(e14[availTimeNum]);
		e14[availTimeNum] = null;
		thisDialog.alphaTime = null;
		thisDialog.alphaTimeNum = null;
		afterAction();
		}
	}
	
e132.create_ATips = function(dialogCreator,content,width){
	var tipsText = dialogCreator.e159("tipsText",content,width-70);
	
	
	
	
	var certainButton = dialogCreator.e161("closeButton",["关闭"],[],[,75,20],
													textures["button_closeX_white"],textures["button_closeX_red"]);
	var nolongerButton = dialogCreator.e161("nolongerButton",["不再提示",15],[],[,75,20],
													textures["button_white"],textures["button_red"]);
	var tipsArray = [0,0,"tips",[],[textures["tips_bg"]],[],[],
						[70,10,tipsText],
						[80,45,certainButton],
						[165,45,nolongerButton]
					 ];
	var tips = dialogCreator.e160(tipsArray);
	tips.e139([0]);
	tips.showBy = function(text,width,second){
		
		clearInterval(this.displayTime);
		this.displayTime = null;
		var nSecond = !second ? 20 : second;
		var nCount = 0;
		this.displayTime = setInterval(function(){tips._timeCounter(nSecond,nCount);nCount++},1000);
		
		if(!e58["nolongerTips"]){
			var width = !width ? 600 : width;
			if(!this.diaplaying){
				this.e138([e1.width-width,20]);
				var tipsText = this.e155("tipsText")
				tipsText.e142([text,,,,,,width-80]);
				tipsText.e139([0]);
				e132.e158(this,0,1);
				
				this.e167();
				this.diaplaying = true;
				}
			else{
				var thisDialog = this;
				e132.e158(this,1,0,10,function(){
													thisDialog.e138([e1.width-width,20]);
													var tipsText = thisDialog.e155("tipsText")
													tipsText.e142([text,,,,,,width-80]);
													tipsText.e139([0]);
													e132.e158(thisDialog,0,1);
													});

				
				
				}
			}
		}
		
	
	tips.hidden = function(){
		if(this.diaplaying){
			clearInterval(this.displayTime);
			e132.e158(this,1,0);
			this.e169();
			this.diaplaying = false;
			this.displayTime = null;
			}
		}
		
	tips.flashDataBy = function(trueDialog){
		switch (trueDialog.name){
		case "closeButton":
			
			clearInterval(this.displayTime);
			e132.e158(this,1,0);
			this.e169();
			this.diaplaying = false;
			this.displayTime = null;
			break;
		case "nolongerButton":
			
			e58["nolongerTips"] = true;
			clearInterval(this.displayTime);
			e132.e158(this,1,0);
			this.e169();
			this.diaplaying = false;
			this.displayTime = null;
			break;
			}
		}
	tips._timeCounter = function(e232,tNow){
		if(e232 < tNow){
			clearInterval(this.displayTime);
			e132.e158(this,1,0);
			this.e169();
			this.diaplaying = false;
			this.displayTime = null;
			}
		}
	return tips;
	}
	

	
e132.basicCreator = function(){
	
	
	}
	
	
e132.basicCreator.prototype.e159 = function(name,content,width){
	var section_text = [];
	section_text[0] = content;
	section_text[6] = width;
	
	var section = new e132.e98(name,section_text,[],[],[]);
	
	return section;
	}
	
	
e132.basicCreator.prototype.e160 = function(dialogArray,translate){
	
	var newDialog;
	var translated = translate;
		if(dialogArray[7]){
			if(typeof dialogArray[2] == "string"){
				newDialog = new e132.e98( dialogArray[2],
									dialogArray[3],
									dialogArray[4],
									dialogArray[5],
									dialogArray[6]
											   );
				}
				else{
					newDialog = dialogArray[2];
					}
			if(!translated){
				newDialog.e138([dialogArray[0],dialogArray[1]]);
				newDialog.x = dialogArray[0];
				newDialog.y = dialogArray[1];
				}
			translated = true;
			for(var n=7;n < dialogArray.length;n++){
					var childDialog;
					var numLength = dialogArray.length;
					childDialog = this.e160(dialogArray[n],translated);
					newDialog.e144([childDialog,dialogArray[n][0],dialogArray[n][1]]);
				}
			return newDialog;
			}
			else{
			if(typeof dialogArray[2] == "string"){
				newDialog = new e132.e98( dialogArray[2],
									dialogArray[3],
									dialogArray[4],
									dialogArray[5],
									dialogArray[6]
											   );
				}
				else{
					newDialog = dialogArray[2];
					}
				if(!translated){
					newDialog.e138([dialogArray[0],dialogArray[1]]);
					newDialog.x = dialogArray[0];
					newDialog.y = dialogArray[1];
					}
				translated = true;
				return newDialog;
				}
	}
	
e132.basicCreator.prototype.e161 = function(name,buttonText,e235,e236,
													   textureUncross,textureCross){
	
	var text = buttonText;
	text[1] = text[1] ?  text[1] : "center";
	text[2] = text[2] ?  text[2] : "middle";
	
	var e237 = [];
	e237["activeDown"] = function(){
			var topParent = e132.e196(this);
			topParent.flashDataBy(this);
			if(mouseCursorStatus && e16 == 0){  
				e15 = mouseCursorStatus;
				mouseCursorStatus = null;
				}
			
		}
	e237["activeLeave"] = function(){
			if(mouseCursorStatus && e16 == 0){  
				e15 = mouseCursorStatus;
				mouseCursorStatus = null;
				}
		if(e58[name+"_cross"]){
			this.e155(name+"show").e135([textureUncross]);
			e58[name+"_cross"] = false;
			}
		}
	e237["activeOver"] = function(){
		
		if(!mouseCursorStatus){
			e16 = 0;
			mouseCursorStatus = e15; 
			e15 = "POINTER";
			}
		
		if(!e58[name+"_cross"]){
			this.e155(name+"show").e135([textureCross]);
			e58[name+"_cross"] = true;
			}
		}
		
	var buttonArray = [0,0,name,text,e235,e236,e237,
						   [0,0,name+"show",[],[textureUncross],[],[]]
						   ];
	var button = this.e160(buttonArray);
	
	return button;
	}

	
e132.basicCreator.prototype.e162 = function(name,defultColor,width,height,e33,e237){
	
	var colorExampleBgColor = new Array;
	colorExampleBgColor[0] = defultColor;
	colorExampleBgColor[1] = width;
	colorExampleBgColor[2] = height;
	colorExampleBgColor[3]= e33;
	var colorExampleBgColorActivtion = new Array;
	if(e237){
		colorExampleBgColorActivtion["activeDown"] = e237["activeDown"];
		colorExampleBgColorActivtion["activeOver"] = e237["activeOver"];
		colorExampleBgColorActivtion["activeDrag"] = e237["activeDrag"];
		colorExampleBgColorActivtion["activeUp"] = e237["activeUp"];
		}
	var colorExample = new e132.e98(name,[],[],colorExampleBgColor,colorExampleBgColorActivtion);
	
	colorExample.upData = function(newColor){
		this.e136(newColor);
		}
		
	return colorExample;
	}
	
	
e132.basicCreator.prototype.e163 = function(name,defultColor,width,height,e33,edge){
	
	var touchEdge = edge == undefined ? 20 : edge;
	var halfEdge = touchEdge/2;
	var e237 = [];
	e237["activeDown"] = e237["activeDrag"] = function (Param){
		var newX = Param[0];
			if(newX>halfEdge+width){newX = halfEdge+width;}
					else if (newX < halfEdge){newX = halfEdge;}
		var colorNum = parseInt(6*(newX-halfEdge)/(this.width-touchEdge));
		var overageX = newX-halfEdge-colorNum*(this.width-touchEdge)/6;
		switch(colorNum){
			case 0:
				var newColor = [1,0,0,1];
				newColor[2] = 6*overageX/(this.width-touchEdge);
				break;
			case 1:
				var newColor = [1,0,1,1];
				newColor[0] = 1-6*overageX/(this.width-touchEdge);
				break;
			case 2:
				var newColor = [0,0,1,1];
				newColor[1] = 6*overageX/(this.width-touchEdge);
				break;
			case 3:
				var newColor = [0,1,1,1];
				newColor[2] = 1-6*overageX/(this.width-touchEdge);
				break;
			case 4:
				var newColor = [0,1,0,1];
				newColor[0] = 6*overageX/(this.width-touchEdge);
				break;
			case 5:
				var newColor = [1,1,0,1];
				newColor[1] = 1-6*overageX/(this.width-touchEdge);
				break;
			case 6:
				var newColor = [1,0,0,1];
				break;
			}
		var topParent = e132.e196(this);
		this.e155("colorLine_cursor").e138([Math.round(newX-5),0]);
		topParent.e155("purePlan_color").e136(newColor);
		topParent.e155("purePlan").flashDataToTop();
		
		}
	
	var colorLineTouch = this.e162(name,
										   [0,0,0,0],
										   width+touchEdge,height+touchEdge,[],e237);
	var colorLineBg = this.e162("colorLine_color",
											 [[1,0,0,1],
											  [1,0,1,1],
											  [0,0,1,1],
											  [0,1,1,1],
											  [0,1,0,1],
											  [1,1,0,1],
											  [1,0,0,1]],
											 width,height,
											 e33);

	var colorLineArray =  [0,0,colorLineTouch,[],[],[],[],
								[halfEdge,halfEdge,colorLineBg],
								[0,0,"colorLine_cursor",[],[textures["setColor_line_cursor"]],[],[]]
						   ];
	
	var colorLine = this.e160(colorLineArray);
	
	colorLine.upData = function(newColor){
		var maxNum;
		var minNum;
		maxNum = newColor[2]>newColor[1] ? 2 : 1;
		maxNum = newColor[maxNum]>newColor[0] ? maxNum : 0;
		switch(maxNum){
			case 0:
			minNum = newColor[1]>newColor[2] ? 2 : 1;
			break;
			case 1:
			minNum = newColor[0]>newColor[2] ? 2 : 0;
			break;
			default:
			minNum = newColor[1]>newColor[0] ? 0 : 1;
			break;
			}
		for(n=0;n < 3;n++){
			if(n!=maxNum && n!=minNum){
				var midNum = n;
				}
			}
		if(newColor[maxNum] != newColor[minNum]){
			newColor[midNum] = (newColor[midNum]-newColor[minNum])/(newColor[maxNum]-newColor[minNum]);
			newColor[minNum] = 0;
			newColor[maxNum] = 1;
			}
			else{
				newColor[maxNum] = 1;
				newColor[midNum] = 0;
				newColor[minNum] = 0;
				}
		var deltaX = halfEdge;
		switch(maxNum){
			case 0:
				switch(midNum){
					case 2:
						deltaX = (this.width-touchEdge)*newColor[2]/6+halfEdge;
						break;
					case 1:
						deltaX = (this.width-touchEdge)*(6-newColor[1])/6+halfEdge;
						break;
					}
				break;
			case 1:
				switch(midNum){
					case 2:
						deltaX = (this.width-touchEdge)*(4-newColor[2])/6+halfEdge;
						break;
					case 0:
						deltaX = (this.width-touchEdge)*(4+newColor[0])/6+halfEdge;
						break;
					default:
						deltaX = (this.width-touchEdge)*5/6+halfEdge;
						break;
					}
				break;
			case 2:
				switch(midNum){
					case 0:
						deltaX = (this.width-touchEdge)*(2-newColor[0])/6+halfEdge;
						break;
					case 1:
						deltaX = (this.width-touchEdge)*(2+newColor[1])/6+halfEdge;
						break;
					default:
						deltaX = (this.width-touchEdge)/6+halfEdge;
						break;
					}
				break;
			}
		this.e155("colorLine_cursor").e138([Math.round(deltaX-5),0]);
		}
	colorLine.upData(defultColor);
	return colorLine;
	}
	
	
e132.basicCreator.prototype.e164 = function(name,defultColor,width,height,edge){
	
	var touchEdge = edge == undefined ? 20 : edge;
	var halfEdge = touchEdge/2;
	var blackCover = this.e162("purePlan_black",
										   [[0, 0, 0, 1], [0, 0, 0, 0]],
										   width,height,"downToUp"
										   );
	var whiteCover = this.e162("purePlan_white",
										   [[1, 1, 1, 1], [1, 1, 1, 0]],
										   width,height,"leftToRight"
										   );
	var colorCoverActivation = [];
		colorCoverActivation["activeDrag"] =
		colorCoverActivation["activeDown"] = function(Param){
			var newX = Param[0];
			var newY = Param[1];
			if(newX>halfEdge+width){newX = halfEdge+width;}
					else if (newX < halfEdge){newX = halfEdge;}
			if(newY>halfEdge+height){newY = halfEdge+height;}
					else if (newY < halfEdge){newY = halfEdge;}
					
			var cursor = this.e155("purePlan_cursor");
			cursor.e138([newX-cursor.width/2,newY-cursor.height/2]);
			this.flashDataToTop();
			}
	var touchCover = this.e162(name,
										   [0, 0, 0, 0.5], 
										   width+touchEdge,height+touchEdge,[],colorCoverActivation
										   );
	var colorCover = this.e162("purePlan_color",
										   defultColor,
										   width,height);
	
	var purePlanArray = [0,0,touchCover,[],[],[],[],
							[halfEdge,halfEdge,colorCover],
							[halfEdge,halfEdge,whiteCover],
							[halfEdge,halfEdge,blackCover],
							[0,0,"purePlan_cursor",[],[textures["setColor_pure_cursor"]],[],[]]
						 ];
	var purePlan = this.e160(purePlanArray);
	purePlan.flashDataToTop = function (){
		var cursor = this.e155("purePlan_cursor");
			var x = cursor.x+cursor.width/2;
			var y = cursor.y+cursor.height/2;
			var purePlan_color = this.e155("purePlan_color");
			var pureColor = [];
			pureColor[0] = purePlan_color.e236[0];
			pureColor[1] = purePlan_color.e236[1];
			pureColor[2] = purePlan_color.e236[2];
			var maxNum;
			var minNum;
			maxNum = pureColor[2]>pureColor[1] ? 2 : 1;
			maxNum = pureColor[maxNum]>pureColor[0] ? maxNum : 0;
			switch(maxNum){
				case 0:
				minNum = pureColor[1]>pureColor[2] ? 2 : 1;
				break;
				case 1:
				minNum = pureColor[0]>pureColor[2] ? 2 : 0;
				break;
				default:
				minNum = pureColor[1]>pureColor[0] ? 0 : 1;
				break;
				}
			for(n=0;n < 3;n++){
				if(n!=maxNum && n!=minNum){
					var midNum = n;
					}
				}
			pureColor[maxNum] = (height-y+halfEdge)/height;
			pureColor[midNum] = pureColor[midNum]*(height-y+halfEdge)/height;
			pureColor[midNum] += (width-x+halfEdge)/width*(pureColor[maxNum]-pureColor[midNum]);
			pureColor[minNum] = pureColor[minNum]*(height-y+halfEdge)/height;
			pureColor[minNum] += (width-x+halfEdge)/width*(pureColor[maxNum]-pureColor[minNum]);
			
			this.value = pureColor;
			var topParent = e132.e196(this);
			topParent.flashDataBy(this);
		}
	
	
	purePlan.upData = function(newColor){
		var maxNum;
		var minNum;
		maxNum = newColor[2]>newColor[1] ? 2 : 1;
		maxNum = newColor[maxNum]>newColor[0] ? maxNum : 0;
		switch(maxNum){
			case 0:
			minNum = newColor[1]>newColor[2] ? 2 : 1;
			break;
			case 1:
			minNum = newColor[0]>newColor[2] ? 2 : 0;
			break;
			default:
			minNum = newColor[1]>newColor[0] ? 0 : 1;
			break;
			}
		for(n=0;n < 3;n++){
			if(n!=maxNum && n!=minNum){
				var midNum = n;
				}
			}
		var deltaX = newColor[maxNum] == 0 ?
					 0 : 
					 Math.round((this.width-touchEdge)*newColor[minNum]/newColor[maxNum])+halfEdge;
		var deltaY = Math.round((this.height-touchEdge)*newColor[maxNum])+halfEdge;
		var cursor = this.e155("purePlan_cursor");
		cursor.e138([this.width-deltaX-cursor.width/2,this.height-deltaY-cursor.height/2]);
		
		if(newColor[maxNum] != newColor[minNum]){
			newColor[midNum] = (newColor[midNum]-newColor[minNum])/(newColor[maxNum]-newColor[minNum]);
			newColor[minNum] = 0;
			newColor[maxNum] = 1;
			}
			else{
				newColor[maxNum] = 1;
				newColor[midNum] = 0;
				newColor[minNum] = 0;
				}
		this.e155("purePlan_color").e136(newColor);
		}
	purePlan.value = defultColor;
	purePlan.upData(defultColor);
	return purePlan;
	}
	 

e132.basicCreator.prototype.e165 = function(name,dragText,pointN,wordShift,
														e60,leftX,rightX,numShift,
														minValue,maxValue){
	
	var startX=leftX,endX=rightX;
	
	var displayValue = e60.toFixed(pointN);
	
	var dragBar_text = [];
		dragBar_text[0] = String(displayValue);
		dragBar_text[1] = numShift;
		dragBar_text[2] = 10;


		
	var dragBar_fun = [];
	
		dragBar_fun["activeDrag"] = dragBar_fun["activeDown"] = function(Param){
			var downX = Param[0];
				if(downX>endX){downX = endX;}
					else if (downX < startX){downX = startX;}
			var value = (downX-startX)/(endX-startX);
				value = value*(maxValue-minValue)+minValue;
				value = parseFloat(value.toFixed(pointN));
			this.value = value;
			this.e142([String(value.toFixed(pointN))]);
			
			this.e155("e19").e138([downX-5,0]);
			
			var topParent = e132.e196(this);
			topParent.flashDataBy(this);
			}
	
	
	var dragFrameX;
		dragFrameX = Math.round(startX+(endX-startX)*(e60-minValue)/(maxValue-minValue));
	var dragFrame_image = [];
		dragFrame_image[0] = textures["setColor_rgb_cursor"];
	

	var dragBarArray = [0,0,name,dragBar_text,[],[,320,20],dragBar_fun,
							[dragFrameX-5,0,"e19",[],dragFrame_image,[],[]],
							[wordShift,8,"dragText",[dragText],[],[],[]]
						];
	var dragBarData;
		dragBarData = this.e160(dragBarArray);
		
		dragBarData.value = displayValue;
		
		dragBarData.upData = function(newValue){
			var value = (newValue-minValue)/(maxValue-minValue);
			var downX = Math.round(startX+value*(endX-startX));
			this.e155("e19").e138([downX-5,0]);
			
			value = value*(maxValue-minValue)+minValue;
			value = parseFloat(value.toFixed(pointN));
			this.value = value;
			
			this.e142([String(value)]);
			}
	return dragBarData;
	}
	

	
e132.e166 = function(dialogCreator,defultColor,e260,e261){




	var dragBar = new Array;

	dragBar[0] = dialogCreator.e165("redBar","红",0,5,
											  defultColor[0]*255,60,315,25,
											  0,255);
	dragBar[1] = dialogCreator.e165("greenBar","绿",0,5,
											  defultColor[1]*255,60,315,25,
											  0,255);
	dragBar[2] = dialogCreator.e165("blueBar","蓝",0,5,
											  defultColor[2]*255,60,315,25,
											  0,255);
	dragBar[3] = dialogCreator.e165("alphaBar","透明度",1,5,
											  defultColor[3],90,315,50,
											  0.1,1);


	var colorPlan = dialogCreator.e162("colorShow",
													 defultColor,
													 75,
													 75);


	var colorLine = dialogCreator.e163("colorLine",
													 [defultColor[0],
													  defultColor[1],
													  defultColor[2],
													  1],
													 192,
													 20,
													 "leftToRight");


	var pureColorPlan = dialogCreator.e164("purePlan",
															 [defultColor[0],
															  defultColor[1],
															  defultColor[2],
															  1],
															 192,70,0);
	


	var certainButton = dialogCreator.e161("certainButton",["确定"],[],[,75,20],
													textures["button_ok_white"],textures["button_ok_blue"]);


	var cencelButton = dialogCreator.e161("cancelButton",["取消"],[],[,75,20],
													textures["button_closeX_white"],textures["button_closeX_red"]);

	var dragFunction = [];
	dragFunction["activeDrag"] = function(Param){
		
		if(!mouseCursorStatus){
			e16 = 1;
			mouseCursorStatus = e15;
			e15 = "MOVE";
			}
	
		var top = e132.e196(this);
			var upOne = this;
			var downX = e49[2],downY = e49[3]
			if(downX>e1.width){downX = e1.width;}
					else if (downX < 0){downX = 0;}
			if(downY>e1.height){downY = e1.height;}
					else if (downY < 0){downY = 0;}
			for(;
				upOne.parent;
				upOne = upOne.parent){
										downX = downX-upOne.x;
										downY = downY-upOne.y;
										}
		top.e138([downX-Param[2],downY-Param[3]]);
		}
	dragFunction["activeDown"] = function(Param){
		
		}
	dragFunction["activeLeave"] = function(Param){
		if(mouseCursorStatus&&e16 ==1 ){
			e15 = mouseCursorStatus;
			mouseCursorStatus=null;
			}
		}
		

	var setDefultColor_function = [];
		setDefultColor_function["activeOver"] = function(){
			
			}

	var setDefultColor_Array = [-720,500,"setDefultColor",[],[],[,610,145],setDefultColor_function,
									[-5,-5,"setDefultColor_frameLine",[],[textures["setColor_cover"]],[],[]],
									[0,0,"dragTitle",[],[],[,610,20],dragFunction,
										[0,0,"dragTitle_bg",["调色板",5,5],[textures["setColor_title"]],[],[]]
										],
									[0,35,dragBar[0]],
									[0,55,dragBar[1]],
									[0,75,dragBar[2]],
									[0,115,dragBar[3]],
									[325,20,colorPlan],
									[411,30,pureColorPlan],
									[401,105,colorLine],
									[325,95,certainButton],
									[325,125,cencelButton]
						  		];
	
	var topDialog =  dialogCreator.e160(setDefultColor_Array);
		topDialog.red = defultColor[0];
		topDialog.green = defultColor[1];
		topDialog.blue = defultColor[2];
		topDialog.alpha = defultColor[3];
		
		topDialog.e260 = e260 ? e260 : function(){};
		topDialog.e261 = e261 ? e261 : function(){};

	topDialog.flashDataBy = function(trueDialog){
		
		
		switch (trueDialog.name){
			case "redBar":
				this.red = this.e155("redBar").value/255;
				this.e155("purePlan").upData([this.red,this.green,this.blue,1]);
				this.e155("colorLine").upData([this.red,this.green,this.blue,1]);
				break;
			case "greenBar":
				this.green = this.e155("greenBar").value/255;
				this.e155("purePlan").upData([this.red,this.green,this.blue,1]);
				this.e155("colorLine").upData([this.red,this.green,this.blue,1]);
				break;
			case "blueBar":
				this.blue = this.e155("blueBar").value/255;
				this.e155("purePlan").upData([this.red,this.green,this.blue,1]);
				this.e155("colorLine").upData([this.red,this.green,this.blue,1]);
				break;
			case "alphaBar":
				this.alpha = this.e155("alphaBar").value;
				break;
			case "purePlan":
				var flashColor = this.e155("purePlan").value;
				this.red = flashColor[0];
				this.green = flashColor[1];
				this.blue = flashColor[2];
				this.e155("redBar").upData(this.red*255);
				this.e155("greenBar").upData(this.green*255);
				this.e155("blueBar").upData(this.blue*255);
				break;
			case "certainButton":
			
			
				this.e260(this.red,this.green,this.blue,this.alpha);
					this.e169();
					
					e132.e158(this,1,0,10);
				break;
			case "cancelButton":
			
				this.e261(this.red,this.green,this.blue,this.alpha);
					this.e169();
					
					e132.e158(this,1,0,10);
				break;
			}
		this.e155("colorShow").upData([this.red,this.green,this.blue,this.alpha]);
		}
	topDialog.upData = function(r,g,b,alpha){
				this.e155("purePlan").upData([r,g,b,1]);
				this.e155("colorLine").upData([r,g,b,1]);
				this.e155("redBar").upData(r*255);
				this.e155("greenBar").upData(g*255);
				this.e155("blueBar").upData(b*255);
				this.e155("alphaBar").upData(alpha);
				this.e155("colorShow").upData([r,g,b,alpha]);
				this.red = r;
				this.green = g;
				this.blue = b;
				this.alpha = alpha;
		}
		
	topDialog.show = function(defultColor,e260,e261){
		this.upData(defultColor[0],defultColor[1],defultColor[2],defultColor[3]);
		this.e260 = e260 ? e260 : function(){};
		this.e261 = e261 ? e261 : function(){};
		this.e138([100,e49[3]-80]);
		e132.e158(this,0,1,10);
		}
	
	return topDialog;
	}




e132.e98.prototype.e167 = function(){
	e64[e64.length] = [];
	e64[e64.length-1].push(this);
	this.changeZ([(e64.length-1)*300]);
	}
	
e132.e98.prototype.e168 = function(parentFrame){
	var nActive;
	for(var n=0;n < e64.length;n++){
		if(e64[n][e64[n].length-1]==parentFrame){
			nActive = n;
			}
		}
	if(nActive != undefined){
		e64[nActive].push(this);
		this.changeZ([(e64[nActive].length-1)*30+nActive*300]);
		}
	}

e132.e98.prototype.e169 = function(){
	var nActive;
	for(var n=0;n < e64.length;n++){
		if(e64[n][e64[n].length-1]==this){
			nActive = n;
			}
		}
	if(nActive != undefined){
		e64[nActive].pop();
		if(!e64[nActive][0]){
			e64.splice(nActive,1);
			}
		for(var n=0;n < e64.length;n++){
			for(var i=0;i < e64[n].length;i++){
				e64[n][i].changeZ([n*300+i*30]);
				}
			}
		}
	}
	
e132.e98.prototype.e170 = function(){
	var nActive;
	for(var n=0;n < e64.length;n++){
		if(e64[n][e64[n].length-1]==this){
			nActive = n;
			}
		}
	return nActive;
	}
var e171 = new Array; 
var e172;  
var e173;   

var e174; 
var e175; 

var e176 = 0; 

var e177;

var e178 = 0; 
var e179 = new Array; 
	
	e179[0] = [[249/255,1/255,1/255,1],
							 [248/255,148/255,0,1],
							 [249/255,188/255,144/255,1],
							 
							 [0,151/255,64/255,1],
							 [96/255,235/255,9/255,1],
							 [249/255,251/255,0,1],
							 
							 [0,59/255,247/255,1],
							 [0,163/255,248/255,1],
							 [159/255,199/255,248/255,1],
							 
							 [104/255,59/255,17/255,1],
							 [145/255,43/255,248/255,1],
							 [249/255,120/255,247/255,1],
							 
							 [0,0,0,1],
							 [128/255,128/255,128/255,1],
							 [249/255,251/255,248/255,1]
							 ];
	
	
	e179[1] = [[184/255,148/255,72/255,1],
							 [207/255,140/255,49/255,1],
							 [200/255,163/255,72/255,1],
							 
							 [120/255,139/255,145/255,1],
							 [144/255,163/255,169/255,1],
							 [144/255,180/255,192/255,1],
							 
							 [160/255,112/255,112/255,1],
							 [200/255,164/255,128/255,1],
							 [224/255,195/255,153/255,1],
							 
							 [80/255,32/255,56/255,1],
							 [104/255,49/255,72/255,1],
							 [120/255,72/255,88/255,1],
							 
							 [0,0,0,1],
							 [88/255,79/255,80/255,1],
							 [249/255,251/255,248/255,1]
							 ];
	
	e179[2] = [[128/255,52/255,56/255,1],
							 [176/255,96/255,89/255,1],
							 [216/255,152/255,143/255,1],
							 
							 [81/255,83/255,80/255,1],
							 [144/255,147/255,136/255,1],
							 [184/255,196/255,176/255,1],
							 
							 [32/255,44/255,40/255,1],
							 [56/255,65/255,64/255,1],
							 [80/255,92/255,88/255,1],
							 
							 [112/255,104/255,81/255,1],
							 [176/255,152/255,104/255,1],
							 [208/255,184/255,136/255,1],
							 
							 [0,0,0,1],
							 [121/255,123/255,120/255,1],
							 [249/255,251/255,248/255,1]
							 ];
	
	e179[3] = [[224/255,76/255,152/255,1],
							 [249/255,163/255,208/255,1],
							 [248/255,215/255,232/255,1],
							 
							 [240/255,205/255,1/255,1],
							 [248/255,236/255,0,1],
							 [244/255,251/255,160/255,1],
							 
							 [40/255,163/255,231/255,1],
							 [119/255,211/255,248/255,1],
							 [193/255,244/255,248/255,1],
							 
							 [136/255,53/255,223/255,1],
							 [193/255,125/255,248/255,1],
							 [240/255,204/255,248/255,1],
							 
							 [0,0,0,1],
							 [121/255,123/255,120/255,1],
							 [249/255,251/255,248/255,1]
							 ];

	e179[4] = [[176/255,160/255,135/255,1],
							 [216/255,200/255,175/255,1],
							 [240/255,232/255,209/255,1],
							 
							 [56/255,43/255,24/255,1],
							 [96/255,80/255,54/255,1],
							 [136/255,120/255,95/255,1],
							 
							 [160/255,160/255,160/255,1],
							 [200/255,200/255,200/255,1],
							 [232/255,232/255,232/255,1],
							 
							 [41/255,43/255,40/255,1],
							 [80/255,80/255,80/255,1],
							 [120/255,120/255,120/255,1],
							 
							 [0,0,0,1],
							 [128/255,128/255,128/255,1],
							 [249/255,251/255,248/255,1]
							 ];

	e179[5] = [[72/255,27/255,144/255,1],
							 [112/255,52/255,208/255,1],
							 [168/255,129/255,248/255,1],
							 
							 [32/255,37/255,167/255,1],
							 [72/255,81/255,248/255,1],
							 [128/255,152/255,248/255,1],
							 
							 [15/255,120/255,168/255,1],
							 [48/255,183/255,247/255,1],
							 [127/255,233/255,247/255,1],
							 
							 [0,103/255,56/255,1],
							 [31/255,168/255,112/255,1],
							 [88/255,231/255,184/255,1],
							 
							 [0,0,0,1],
							 [121/255,123/255,120/255,1],
							 [249/255,251/255,248/255,1]
							 ];

	e179[6] = [[104/255,92/255,16/255,1],
							 [184/255,145/255,16/255,1],
							 [232/255,203/255,73/255,1],
							 
							 [120/255,132/255,128/255,1],
							 [161/255,172/255,176/255,1],
							 [217/255,228/255,232/255,1],
							 
							 [64/255,36/255,24/255,1],
							 [112/255,68/255,41/255,1],
							 [168/255,120/255,97/255,1],
							 
							 [24/255,44/255,32/255,1],
							 [64/255,100/255,72/255,1],
							 [128/255,160/255,136/255,1],
							 
							 [0,0,0,1],
							 [121/255,123/255,120/255,1],
							 [249/255,251/255,248/255,1]
							 ];

	e179[7] = [[184/255,60/255,8/255,1],
							 [248/255,117/255,1/255,1],
							 [248/255,200/255,136/255,1],
							 
							 [168/255,132/255,56/255,1],
							 [232/255,203/255,73/255,1],
							 [248/255,236/255,152/255,1],
							 
							 [0,111/255,104/255,1],
							 [40/255,171/255,137/255,1],
							 [169/255,216/255,184/255,1],
							 
							 [31/255,60/255,120/255,1],
							 [80/255,100/255,199/255,1],
							 [168/255,180/255,232/255,1],
							 
							 [0,0,0,1],
							 [122/255,122/255,120/255,1],
							 [249/255,251/255,248/255,1]
							 ];

	e179[8] = [[135/255,161/255,176/255,1],
							 [175/255,201/255,216/255,1],
							 [208/255,233/255,240/255,1],
							 
							 [24/255,44/255,55/255,1],
							 [55/255,81/255,96/255,1],
							 [95/255,121/255,136/255,1],
							 
							 [175/255,140/255,160/255,1],
							 [214/255,181/255,198/255,1],
							 [240/255,213/255,232/255,1],
							 
							 [56/255,28/255,40/255,1],
							 [95/255,60/255,80/255,1],
							 [135/255,100/255,120/255,1],
							 
							 [0,0,0,1],
							 [128/255,128/255,128/255,1],
							 [249/255,251/255,248/255,1]
							 ];

	e179[9] = [[144/255,1/255,143/255,1],
							 [241/255,0,231/255,1],
							 [248/255,140/255,241/255,1],
							 
							 [141/255,33/255,57/255,1],
							 [224/255,16/255,65/255,1],
							 [249/255,128/255,145/255,1],
							 
							 [168/255,88/255,1/255,1],
							 [240/255,125/255,0,1],
							 [248/255,192/255,105/255,1],
							 
							 [168/255,153/255,0,1],
							 [239/255,212/255,1/255,1],
							 [248/255,249/255,113/255,1],
							 
							 [0,0,0,1],
							 [121/255,123/255,120/255,1],
							 [249/255,251/255,248/255,1]
							 ];

	e179[10] = [[144/255,4/255,127/255,1],
							 [225/255,1/255,136/255,1],
							 [249/255,136/255,224/255,1],
							 
							 [168/255,49/255,9/255,1],
							 [249/255,116/255,25/255,1],
							 [248/255,195/255,1/255,1],
							 
							 [64/255,131/255,25/255,1],
							 [120/255,196/255,0,1],
							 [209/255,251/255,1/255,1],
							 
							 [41/255,75/255,120/255,1],
							 [0,148/255,168/255,1],
							 [0,252/255,249/255,1],
							 
							 [0,0,0,1],
							 [121/255,123/255,120/255,1],
							 [249/255,251/255,248/255,1]
							 ];

	e179[11] = [[128/255,48/255,49/255,1],
							 [177/255,104/255,9/255,1],
							 [184/255,148/255,88/255,1],
							 
							 [0,104/255,64/255,1],
							 [72/255,157/255,40/255,1],
							 [169/255,172/255,41/255,1],
							 
							 [40/255,79/255,144/255,1],
							 [56/255,119/255,160/255,1],
							 [112/255,156/255,191/255,1],
							 
							 [72/255,56/255,40/255,1],
							 [96/255,65/255,143/255,1],
							 [168/255,88/255,161/255,1],
							 
							 [0,0,0,1],
							 [129/255,131/255,128/255,1],
							 [249/255,251/255,248/255,1]
							 ];

	e179[12] = [[0,52/255,73/255,1],
							 [0,119/255,73/255,1],
							 [0,172/255,88/255,1],
							 
							 [0,148/255,88/255,1],
							 [8/255,163/255,121/255,1],
							 [96/255,171/255,16/255,1],
							 
							 [72/255,132/255,143/255,1],
							 [111/255,180/255,177/255,1],
							 [184/255,212/255,233/255,1],
							 
							 [224/255,228/255,240/255,1],
							 [224/255,245/255,240/255,1],
							 [249/255,251/255,248/255,1],
							 
							 [160/255,64/255,16/255,1],
							 [207/255,140/255,49/255,1],
							 [200/255,163/255,72/255,1]
							 ];

	e179[13] = [[153/255,80/255,48/255,1],
							 [216/255,140/255,80/255,1],
							 [248/255,180/255,145/255,1],
							 
							 [57/255,31/255,16/255,1],
							 [111/255,65/255,32/255,1],
							 [192/255,156/255,96/255,1],
							 
							 [96/255,65/255,143/255,1],
							 [72/255,87/255,168/255,1],
							 [56/255,111/255,88/255,1],
							 
							 [128/255,48/255,49/255,1],
							 [200/255,64/255,64/255,1],
							 [249/255,120/255,0,1],
							 
							 [0,0,0,1],
							 [104/255,113/255,112/255,1],
							 [249/255,251/255,248/255,1]
							 ];

	e179[14] = [[80/255,20/255,56/255,1],
							 [160/255,45/255,112/255,1],
							 [232/255,117/255,184/255,1],
							 
							 [72/255,52/255,25/255,1],
							 [161/255,121/255,72/255,1],
							 [224/255,188/255,112/255,1],
							 
							 [24/255,64/255,72/255,1],
							 [63/255,129/255,145/255,1],
							 [112/255,188/255,224/255,1],
							 
							 [56/255,28/255,79/255,1],
							 [120/255,68/255,168/255,1],
							 [185/255,120/255,224/255,1],
							 
							 [0,0,0,1],
							 [121/255,123/255,120/255,1],
							 [249/255,251/255,248/255,1]
							 ];

	e179[15] = [[248/255,105/255,1/255,1],
							 [248/255,164/255,40/255,1],
							 [248/255,205/255,113/255,1],
							 
							 [56/255,203/255,1/255,1],
							 [168/255,244/255,32/255,1],
							 [248/255,252/255,113/255,1],
							 
							 [0,143/255,248/255,1],
							 [104/255,195/255,248/255,1],
							 [183/255,228/255,247/255,1],
							 
							 [185/255,120/255,40/255,1],
							 [216/255,116/255,248/255,1],
							 [249/255,184/255,224/255,1],
							 
							 [0,0,0,1],
							 [128/255,128/255,128/255,1],
							 [249/255,251/255,248/255,1]
							 ];
	


e132.e180 = function(){
	var colorExampleBgColor = new Array;
	colorExampleBgColor[0] = [
								e60.red,
								e60.green,
								e60.blue,
								e60.alpha];
	colorExampleBgColor[1] = 75;
	colorExampleBgColor[2] = 75;
	
	var colorExampleBgColorActivtion = new Array;
	colorExampleBgColorActivtion["activeDown"] = function (){  
		
		
		var e260 = function(r,g,b,alpha){
			e60.red = r;
			e60.green = g;
			e60.blue = b;
			e60.alpha = alpha;
			colorExample.e136([r,g,b,alpha]);
			}
		e132.setColor.show([e60.red,
							  e60.green,
							  e60.blue,
							  e60.alpha],
							 e260);
		
		var top = e132.e196(colorExample);
		e132.setColor.e168(top);
		}
	
	var colorExample = new e132.e98("colorExample",[],[],colorExampleBgColor,colorExampleBgColorActivtion);
	return colorExample;
	}




e132.e181 = function(){
	var colorBgColor = new Array;
	colorBgColor[0] = [e60.red,e60.green,e60.blue,e60.alpha];
	colorBgColor[1] = 75;
	colorBgColor[2] = 35;
	
	var colorFrame = new e132.e98("comparisonColor",[],[],colorBgColor,[]);
	
	var thisTexture = new Array;
		thisTexture[0] = textures["comparisonBg"];
	
	thisFrame = new e132.e98("e181",[],thisTexture,[],[]);
	thisFrame.e144([colorFrame,0,0]);
	return thisFrame;
	}


e132.e182 = function(){
	var thisBgColor = new Array;
	thisBgColor[1] = 75;
	thisBgColor[2] = 75;
	
	var thisFrame = new e132.e98("colorGlobal",[],[],thisBgColor,[]);
	var colorExample = e132.e180();
	
	thisFrame.e144([colorExample,0,0]);
	return thisFrame
	}


e132.e183 = function(){
	var thisBgColor = new Array;
	thisBgColor[0] = [e60.red,e60.green,e60.blue,e60.alpha];
	thisBgColor[1] = 24;
	thisBgColor[2] = 24;
	
	var thisActivtion = new Array;
	
	thisActivtion["activeDown"] = function (){ 
	
	
	e17.e151("brushColor",["e136",[this.e236[0],
																		this.e236[1],
																		this.e236[2],
																		1]])
	
	
	
	if(this.parent.parent.name == "colorCustomizeFrame"){
		
		
			var changeTexture = new Array;
				changeTexture[0] =  textures["changeButton"];
			var changeActive = new Array;
				changeActive["activeDown"] = function(){
					this.e135([textures["changeButton"]]);
					
					var e260 = function(r,g,b,alpha){
						e173.e136([r,g,b,alpha]);
						var findFrames = e174.e195(["colorCustomizeFrame"]);
						var theLibrary = findFrames[0].e195(["colorLibrary"]);
							for(var n=0;n < theLibrary[0].child.length;n++){
								e171[n][0] = theLibrary[0].child[n].e236[0];
								e171[n][1] = theLibrary[0].child[n].e236[1];
								e171[n][2] = theLibrary[0].child[n].e236[2];
								e171[n][3] = theLibrary[0].child[n].e236[3];
								}
						}
					
					e132.setColor.show(e173.e236,e260);
					var top = e132.e196(e173);
					e132.setColor.e168(top);
					}
				changeActive["activeOver"] = function(){
					this.e135([textures["changeButtonOn"]]);
				}
				changeActive["activeLeave"] = function(){
					this.e135([textures["changeButton"]]);
				}
		
		var changeButton = new e132.e98("changeButton",[],changeTexture,[],changeActive);
		
			
			var deleteTexture = new Array;
				deleteTexture[0] =  textures["deleteButton"];
			var deleteActive = new Array;
				deleteActive["activeDown"] = function(){
					this.e135([textures["deleteButtonOn"]]);
				
					
					
					e174.e194(["colorMarkSign"]);
					var thisColorLibrary = this.parent.e195(["colorLibrary"]);
					for(var colorN = 0;colorN < thisColorLibrary[0].child.length;colorN++){
						if(thisColorLibrary[0].child[colorN] == e173 ){
							thisColorLibrary[0].e194(["colorBlock"]);
							e171.splice(colorN,1);
							
							if(e171.length == 0){
								e174.e194(["emptyButton"]);
								e174.e194(["joinButton"]);
								e174.e194(["changeButton"]);
								e174.e194(["deleteButton"]);
								}
							var ii = 0;
							for(var n = 0;n < e171.length ;n++){
								var aNewColorUnit = e132.e183();
								aNewColorUnit.e136([e171[n][0],
																e171[n][1],
																e171[n][2],
																e171[n][3]
																 ]);		
						
								if(n%3 == 0){ii = n/3}
								thisColorLibrary[0].e144([aNewColorUnit,n%3*25+1,ii*25+1]);
								}
							}
						
						}
						
										
										
						
					}
				deleteActive["activeOver"] = function(){
					this.e135([textures["deleteButtonOn"]]);
					
					
					
					
					
					
				}
				deleteActive["activeLeave"] = function(){
					this.e135([textures["deleteButton"]]);
				}
		
		var deleteButton = new e132.e98("deleteButton",[],deleteTexture,[],deleteActive);
		
		this.parent.parent.e144([changeButton,79,23]);
		this.parent.parent.e144([deleteButton,79,48]);
		}else{
			e174.e194(["changeButton"]);
			e174.e194(["deleteButton"]);
			}
	
	
		var colorMarkSelect = new Array;
		colorMarkSelect = e174.e195(["colorMarkSign"]);
		if(colorMarkSelect[0]){
			colorMarkSelect[0].e138([this.parent.parent.x+this.parent.x+this.x,this.parent.parent.y+this.parent.y+this.y]);
			}else{
				e174.e194(["colorMarkSign"]);
				colorMarkSelect[0]= new e132.e98("colorMarkSign",[],[textures["colorMark"]],[],[]);
				e174.e144([colorMarkSelect[0],this.parent.parent.x+this.parent.x+this.x,this.parent.parent.y+this.parent.y+this.y]);
				colorMarkSelect[0].changeZ([8]);
				}
				
		e60.red = this.e236[0];
		e60.green = this.e236[1];
		e60.blue = this.e236[2];
		e60.alpha = this.e236[3];
		
		this.e137([0.97]); 
		
		e173 = this;
		
		for (var n = 0;n < e64.length ;n++){
			for (var nSub = 0;nSub < e64[n].length ;nSub++){
				e64[n][nSub].e151("colorExample",["e136",[e60.red,
																					e60.green,
																					e60.blue,
																					e60.alpha
																						]]);
				}
			}
		}
	thisActivtion["activeOver"] = function (){ 
			this.e137([1]);
			var thisTop = e132.e196(this);
			
			thisTop.e194(["e181"]);
			
			var e181 = e132.e181();
			e181.child[0].e136([this.e236[0],
										   this.e236[1],
										   this.e236[2],
										   this.e236[3]]);
			
			thisTop.e151("colorGlobal",["e144",[e181,0,40]]);
			}

	var colorBlock = new e132.e98("colorBlock",[],[],thisBgColor,thisActivtion);
	return colorBlock;
	}


e132.e184 = function(colorArray,maxNo){
	var thisBgColor = new Array;
	thisBgColor[1] = 75;
	thisBgColor[2] = 125;
	
	var thisFrame = new e132.e98("colorLibrary",[],[],thisBgColor,[]); 
	 
	if(colorArray){
	var ii = 0;
		for(var n = 0;n < colorArray.length;n++){
			var aNewColorUnit = e132.e183();
			aNewColorUnit.e136([colorArray[n][0],
											colorArray[n][1],
											colorArray[n][2],
											colorArray[n][3]
											 ]);		
	
			if(n%3 == 0){ii = n/3;}
			thisFrame.e144([aNewColorUnit,n%3*25+1,ii*25+1]);
			}
		for(var nn=colorArray.length;nn < maxNo;nn++){
			var aNewColorUnit = e132.e183();
			aNewColorUnit.e136([0,0,0,0]);
			if(nn%3 == 0){ ii = nn/3;}
			thisFrame.e144([aNewColorUnit,nn%3*25+1,ii*25+1]);
			aNewColorUnit.e153();
			}
		}else{
			var ii = 0;
			for(var n=0;n < maxNo;n++){
				var aNewColorUnit = e132.e183();
				aNewColorUnit.e136([0,0,0,0]);
				if(n%3 == 0){ ii = n/3;}
				thisFrame.e144([aNewColorUnit,n%3*25+1,ii*25+1]);
				aNewColorUnit.e153();
				}
			}
	return thisFrame;
	}


e132.e185 = function(){
	
	var thisBgColor = new Array;
	thisBgColor[1] = 75;
	thisBgColor[2] = 75;
	
	var thisFrame = new e132.e98("colorOften",[],[],thisBgColor,[]);
	 
	var ii = 0;
	for(var n=0;n < e61.length && n < 9;n++){
		
		var aNewColorOftenUnit = e132.e183();
		
		aNewColorOftenUnit.e136([e61[n][0][0]/255,
										  e61[n][0][1]/255,
										  e61[n][0][2]/255,
										  e61[n][0][3]/255
															]);
		if(n%3 == 0){ii = n/3}
		thisFrame.e144([aNewColorOftenUnit,n%3*25+1,ii*25+1]);
		}
	return thisFrame;
	}	


e132.e186 = function(contentText){
	var thisText = new Array;
	thisText[0] = contentText;
	thisText[1] = "left";
	thisText[2] = "middle";
	thisText[4] = 10;
	
	var thisBgColor = new Array;
	thisBgColor[1] = 80;
	thisBgColor[2] = 20;
	
	var thisTitle = new e132.e98("thisTitle",thisText,[],thisBgColor,[]);
	return thisTitle;
	}



e132.createEmptyButtonCustomize = function(){
	var emptyTexture = new Array;
		emptyTexture[0] =  textures["emptyButton"];
	var emptyActive = new Array;
		emptyActive["activeDown"] = function(){
			this.e135([textures["emptyButton"]]);
			
			e171 = [];
			var findFrames = e174.e195(["colorCustomizeFrame"]);
			findFrames[0].e194(["colorBlock"]);
			e174.e194(["emptyButton"]);
			e174.e194(["joinButton"]);
			e174.e194(["changeButton"]);
			e174.e194(["deleteButton"]);
			e174.e194(["colorMarkSign"]);
			}
		emptyActive["activeOver"] = function(){
			this.e135([textures["emptyButtonOn"]]);
			
			if(!mouseCursorStatus){
				e16 = 2;
				mouseCursorStatus = e15;
				e15 = "DEFAULT";
				}
			if(this.child[0]){
				this.child[0].e139([1]);
				}else{
					
						var buttonTipsBlackBg =  new e132.e98("buttonTipsBlackBg",[],[],[[0,0,0,1],80,18],[]);
						var buttonTips =  new e132.e98("buttonTips",["清空配色方案","center","middle"],[],[[0.9,0.9,0.9,1],78,16],[]);
						
						buttonTipsBlackBg.e144([buttonTips,1,1]);
						this.e144([buttonTipsBlackBg,20,20]);
						buttonTipsBlackBg.changeZ([8]);
					}		
			
		}
		emptyActive["activeLeave"] = function(){
			if(mouseCursorStatus && e16 == 2){
				e15 = mouseCursorStatus;
				mouseCursorStatus=null;
				}

			this.e135([textures["emptyButton"]]);
			if(this.child[0]){
				this.child[0].e139([0]);
			}
		}
			
	var emptyButton = new e132.e98("emptyButton",[],emptyTexture,[],emptyActive);
	return emptyButton;
	}




e132.e187 = function(){
	var joinTexture = new Array;
		joinTexture[0] =  textures["joinButton"];
	var joinActive = new Array;
		joinActive["activeDown"] = function(){
			this.e135([textures["joinButton"]]);
			if(e171.length != 0){
				var colorConversion = new Array;
				for(var ii =0;ii < e171.length;ii++){
					colorConversion[ii] =  new Array;
					
					colorConversion[ii][0] = e171[ii][0];
					colorConversion[ii][1] = e171[ii][1];
					colorConversion[ii][2] = e171[ii][2];
					colorConversion[ii][3] = e171[ii][3];
					
					}
				e179.push(colorConversion);
					
				}
			}
		joinActive["activeOver"] = function(){
			
			if(!mouseCursorStatus){
				e16 = 3;
				mouseCursorStatus = e15;
				e15 = "DEFAULT";
				}
			
			this.e135([textures["joinButtonOn"]]);
			
			if(this.child[0]){
				this.child[0].e139([1]);
				}else{
					
						var buttonTipsBlackBg =  new e132.e98("buttonTipsBlackBg",[],[],[[0,0,0,1],80,18],[]);
						var buttonTips =  new e132.e98("buttonTips",["加入配色方案","center","middle"],[],[[0.9,0.9,0.9,1],78,16],[]);
						
						buttonTipsBlackBg.e144([buttonTips,1,1]);
						this.e144([buttonTipsBlackBg,20,20]);
						buttonTipsBlackBg.changeZ([8]);
					}		
		}
		joinActive["activeLeave"] = function(){
			if( mouseCursorStatus && e16==3){
				e15 = mouseCursorStatus;
				mouseCursorStatus = null;
				}
			
			this.e135([textures["joinButton"]]);
			if(this.child[0]){
				this.child[0].e139([0]);
				}
		}
	var joinButton = new e132.e98("joinButton",[],joinTexture,[],joinActive);
	return 	joinButton;
		}




e132.e188 = function(){
	
	var thisTexture = new Array;
		thisTexture[0] = textures["colorLibrary"];
	
	e174 = new e132.e98("e174",[],thisTexture,[],[]);
	
	e174.activeOver = function(){
		this.e194(["e181"]);
		}
	e174.activeLeave = function(){
		this.e194(["e181"]);
		}



	var colorLibraryFrameBody = e132.e184(e179[e178],15);
	
	
	var colorLibraryBgColor = new Array;
	colorLibraryBgColor[1] = 105;
	colorLibraryBgColor[2] = 150;
	
	var colorLibraryFrame = new e132.e98("colorLibraryFrame",[],[],colorLibraryBgColor,[]);
	
	colorLibraryFrame.e144([colorLibraryFrameBody,2,22]);
	
	if(e179.length > 1){
		
		var switchTexture = new Array;
			switchTexture[0] =  textures["switchButton"];
		var switchActive = new Array;
			switchActive["activeDown"] = function(){
				this.e135([textures["switchButton"]]);
				e132.e191(e176);
				}
			switchActive["activeOver"] = function(){
				this.e135([textures["switchButtonOn"]]);
				if(!mouseCursorStatus){
					e16 =4;
					mouseCursorStatus = e15;
					e15 = "DEFAULT";
					}
				
			if(this.child[0]){
				this.child[0].e139([1]);
				}else{
					
						var buttonTipsBlackBg =  new e132.e98("buttonTipsBlackBg",[],[],[[0,0,0,1],80,18],[]);
						var buttonTips =  new e132.e98("buttonTips",["更改颜色方案","center","middle"],[],[[0.9,0.9,0.9,1],78,16],[]);
						
						buttonTipsBlackBg.e144([buttonTips,1,1]);
						this.e144([buttonTipsBlackBg,20,20]);
						buttonTipsBlackBg.changeZ([8]);
					}		
				
				}
			switchActive["activeLeave"] = function(){
				
				if(mouseCursorStatus  && e16 == 4 ){
					e15 =mouseCursorStatus;
					mouseCursorStatus= null;
					}
				
				this.e135([textures["switchButton"]]);
				if(this.child[0]){
					this.child[0].e139([0]);
					}
				}
		var switchButton = 	 new e132.e98("switchButton",[],switchTexture,[],switchActive);
		
		colorLibraryFrame.e144([switchButton,79,23]);
		}			
	
	

	var colorCustomizeBody = e132.e184(e171,15);

	
	var colorCustomizeBgColor = new Array;
	colorCustomizeBgColor[1] = 105;
	colorCustomizeBgColor[2] = 150;
	
	var colorCustomizeFrame = new e132.e98("colorCustomizeFrame",[],[],colorCustomizeBgColor,[]);
	
	colorCustomizeFrame.e144([colorCustomizeBody,2,22]);
	
	if(e171.length != 0){
			
		var emptyButton = e132.createEmptyButtonCustomize();
			
			
		var joinButton = e132.e187();
		
	colorCustomizeFrame.e144([emptyButton,79,73]);
	colorCustomizeFrame.e144([joinButton,79,98]);
		}
	

	
	var colorOftenFrameBody = e132.e185();
	
	var colorOftenBgColor = new Array;
	colorOftenBgColor[1] = 105;
	colorOftenBgColor[2] = 100;
	
	var colorOftenFrame = new e132.e98("colorOftenFrame",[],[],colorOftenBgColor,[]);
	
	colorOftenFrame.e144([colorOftenFrameBody,2,22]);

	var colorExampleBody = e132.e182();
	
	
	var customizeTexture = new Array;
		customizeTexture[0] =  textures["customizeButton"];
	var customizeActive = new Array;
		customizeActive["activeDown"] = function(){
			
		
		var thisFindFrames = e174.e195(["colorCustomizeFrame"]);
		var haveButton = false; 
		for(var c =0;c < thisFindFrames[0].child.length;c++){
			if(thisFindFrames[0].child[c].name == "emptyButton"){
				haveButton = true; 
				}
			}
		if(!haveButton){
		var emptyButton = e132.createEmptyButtonCustomize();
			
			
		var joinButton = e132.e187();
		thisFindFrames[0].e144([emptyButton,79,73]);
		thisFindFrames[0].e144([joinButton,79,98]);
			}
		
		this.e135([textures["customizeButton"]]);
			
		e172 = [e60.red,
						e60.green,
						e60.blue,
						e60.alpha];
		
		var ifHave = false; 
		for(var n=0;n < e171.length;n++){
			if(e172.toString() == e171[n].toString()){
				ifHave = true;
				e132.tips.showBy("自定义中已经存在此颜色",500);
				}
			}
		if(!ifHave){
			if(e171.length < 15){
				e171.push(e172);
				
				
				var findFrames = e174.e195(["colorCustomizeFrame"]);
				var theLibrary = findFrames[0].e195(["colorLibrary"]);
				var colorBlock = e132.e183();
				var ii = (e171.length-1 - (e171.length-1)%3)/3;
				theLibrary[0].e144([colorBlock,(e171.length-1)%3*25+1,ii*25+1]);
				for(var k=0;k < e171.length;k++){
					theLibrary[0].child[k].e136([e171[k][0],
														  e171[k][1],
														  e171[k][2],
														  e171[k][3]]);
										}
					}else{
						e132.tips.showBy("自定义颜色数目不能超过15个",500);
						}
				}
			}
			
		customizeActive["activeOver"] = function(){
			this.e135([textures["customizeButtonOn"]]);
			if(this.child[0]){
				this.child[0].e139([1]);
				}else{
					
						var buttonTipsBlackBg =  new e132.e98("buttonTipsBlackBg",[],[],[[0,0,0,1],80,18],[]);
						var buttonTips =  new e132.e98("buttonTips",["加入我的颜色","center","middle"],[],[[0.9,0.9,0.9,1],78,16],[]);
						
						buttonTipsBlackBg.e144([buttonTips,1,1]);
						this.e144([buttonTipsBlackBg,20,20]);
						buttonTipsBlackBg.changeZ([8]);
					}		
		}
		customizeActive["activeLeave"] = function(){
			this.e135([textures["customizeButton"]]);
			if(this.child[0]){
				this.child[0].e139([0]);
				}
		}
 
 var customizeButton = new e132.e98("customizeButton",[],customizeTexture,[],customizeActive);
	
	
	var dropperTexture = new Array;   
		dropperTexture[0] =  textures["dropperButton"];
	var dropperActive = new Array;
		dropperActive["activeDown"] = function(){
			this.e135([textures["dropperButtonOn"]]);
			}
		dropperActive["activeOver"] = function(){
			this.e135([textures["dropperButtonOn"]]);
			if(this.child[0]){
				this.child[0].e139([1]);
				}else{
					
						var buttonTipsBlackBg =  new e132.e98("buttonTipsBlackBg",[],[],[[0,0,0,1],80,18],[]);
						var buttonTips =  new e132.e98("buttonTips",["拾取颜色","center","middle"],[],[[0.9,0.9,0.9,1],78,16],[]);
						
						buttonTipsBlackBg.e144([buttonTips,1,1]);
						this.e144([buttonTipsBlackBg,20,20]);
						buttonTipsBlackBg.changeZ([8]);
					}		
		}
		dropperActive["activeLeave"] = function(){
			this.e135([textures["dropperButton"]]);
			if(this.child[0]){
				this.child[0].e139([0]);
				}
			
		}

var dropperButton = new e132.e98("dropperButton",[],dropperTexture,[],dropperActive);


	var colorExampleBgColor = new Array;
		colorExampleBgColor[1] = 105;
		colorExampleBgColor[2] = 100;
	
	var colorExampleFrame = new e132.e98("colorExampleFrame",[],[],colorExampleBgColor,[]);
	
	colorExampleFrame.e144([colorExampleBody,2,22]);
	colorExampleFrame.e144([customizeButton,79,23]);
	colorExampleFrame.e144([dropperButton,79,48]);
	
	

	var themeTexture = new Array;
		themeTexture[0] = textures["colorTBg"];

	var colorTheme = new e132.e98("colorTheme",[],themeTexture,[],[]);
	
	var textLibrary =  e132.e186("配色方案");
	var textCustomize = e132.e186("我的颜色");
	var textOften = e132.e186("常用颜色");
	var textNow = e132.e186("当前色彩");
	
	colorTheme.e144([textLibrary,2,10]);
	colorTheme.e144([textCustomize,2,160]);
	colorTheme.e144([textOften,2,310]);
	colorTheme.e144([textNow,2,410]);
	

	
	e174.e144([colorLibraryFrame,0,5]);
	e174.e144([colorCustomizeFrame,0,155]);
	e174.e144([colorOftenFrame,0,305]);
	e174.e144([colorExampleFrame,0,405]);
	e174.e144([colorTheme,0,0]);

	colorTheme.changeZ([10]);

	e174.e138([-e174.width,0]);
	e132.e156(e174,0,0);
	e132.tips.showBy("画笔涂抹模式已经打开，先在左边点中想要使用的色彩，然后到场景中的方块上点击就可以上色了。可以单击上色；或者点中后按住左键不放，利用拖动给多个方块上色。  PS：点中空白的地方会退回编辑模式，所以...你可要看准了!",800);
	e174.e167();
	}





e132.e189 = function(){
	var thisBgColor = new Array;
	thisBgColor[0] = [1,1,1,1];
	thisBgColor[1] = 20;
	thisBgColor[2] = 20;
	
	var thisFrame = new e132.e98("e189",[],[],thisBgColor,[]);
	return thisFrame;
	}


e132.e190 = function(No){
	var thisBgColor = new Array;
	thisBgColor[1] = 68;
	thisBgColor[2] = 108;
	
	var thisActivtion = new Array;
	thisActivtion["activeDown"] = function (){ 
  	e178 = No;
	

	e175.transform.parent = null;
	e175.e169();
	e132.e157(e175);
		

		var findFrames = e174.e195(["colorLibraryFrame"]);
		var theLibrary = findFrames[0].e195(["colorLibrary"]);
		var copyLibrary0 = this.e195(["longColorItem0"]);
		var copyLibraryColors0 = copyLibrary0[0].e195(["e189"]);
		
		var copyLibrary1 = this.e195(["longColorItem1"]);
		var copyLibraryColors1 = copyLibrary1[0].e195(["e189"]);
		
		var copyLibrary2 = this.e195(["longColorItem2"]);
		var copyLibraryColors2 = copyLibrary2[0].e195(["e189"]);
		
			for(var k=0;k < 15;k++){
					if(k%3==0 && k/3 < copyLibraryColors0.length){
						theLibrary[0].child[k].e154();
						theLibrary[0].child[k].e136([copyLibraryColors0[k/3].e236[0],
															   copyLibraryColors0[k/3].e236[1],
															   copyLibraryColors0[k/3].e236[2],
															   copyLibraryColors0[k/3].e236[3]
															  ]);
						}else if(k%3==1 && (k-1)/3 < copyLibraryColors1.length){
						theLibrary[0].child[k].e154();
						theLibrary[0].child[k].e136([copyLibraryColors1[(k-1)/3].e236[0],
															   copyLibraryColors1[(k-1)/3].e236[1],
															   copyLibraryColors1[(k-1)/3].e236[2],
															   copyLibraryColors1[(k-1)/3].e236[3]
															  ]);
							}else if(k%3==2 && (k-2)/3 < copyLibraryColors2.length){
							theLibrary[0].child[k].e154();
							theLibrary[0].child[k].e136([copyLibraryColors2[(k-2)/3].e236[0],
																   copyLibraryColors2[(k-2)/3].e236[1],
																   copyLibraryColors2[(k-2)/3].e236[2],
																   copyLibraryColors2[(k-2)/3].e236[3]
																  ]);
								}else{
									theLibrary[0].child[k].e136([0,0,0,0]);
									theLibrary[0].child[k].e153();
									}
					}
			}
	thisActivtion["activeOver"] = function(){ 
		var markSelect = new Array;
		markSelect = e175.e195(["markSign"]);
		if(markSelect[0]){
			markSelect[0].e138([this.x,this.y-11]);
			var compColorNo = e175.e195(["e190"]);
			for(var thisNo=0;thisNo < compColorNo.length;thisNo++){
				if(this == compColorNo[thisNo]){
					markSelect[0].markNo = thisNo;
					}
				}
			}else{
				markSelect[0]= new e132.e98("markSign",[],[textures["librarySelect_cursor"]],[],[]);
				e175.e144([markSelect[0],this.x,this.y-11]);
				markSelect[0].changeZ([8]);
				var compColorNo = e175.e195(["e190"]);
				for(var thisNo=0;thisNo < compColorNo.length;thisNo++){
					if(this == compColorNo[thisNo]){
						markSelect[0].markNo = thisNo;
						}
					}
				
				
				var colorDeleteActive = new Array;
				colorDeleteActive["activeDown"] = function(){
					
					
						if(e179.length>7){
							if(e176+7 == e179.length){
								e176--;
								var thisTop = e132.e196(this);
								var chooseColors =  thisTop.e195(["e190"]);
								e132.e192(chooseColors.slice(0,this.parent.markNo),73,0,10,0);
								
								chooseColors[this.parent.markNo].e138([-500,-500]);
								var thisTopChildLength = thisTop.child.length; 
								for(var thisN = 0;thisN < thisTopChildLength;thisN++){
									if(thisTop.child[thisN] == chooseColors[this.parent.markNo]){
										thisTop.child.splice(thisN,1);
										}
									}
								e175.e194(["markSign"]);
								}else{
									var thisTop = e132.e196(this);
									var chooseColors =  thisTop.e195(["e190"]);
									e132.e192(chooseColors.slice(this.parent.markNo+1,chooseColors.length),-73,0,10,this.parent.markNo);
									chooseColors[this.parent.markNo].e138([-500,-500]);
									
									var thisTopChildLength = thisTop.child.length; 
									for(var thisN = 0;thisN < thisTopChildLength;thisN++){
										if(thisTop.child[thisN] == chooseColors[this.parent.markNo]){
											thisTop.child.splice(thisN,1);
											}
										}
									
									e175.e194(["markSign"]);
									}
					}else{
						
						var thisTop = e132.e196(this);
						var chooseColors =  thisTop.e195(["e190"]);
						if(this.parent.markNo != chooseColors.length-1){
							e132.e192(chooseColors.slice(this.parent.markNo+1,chooseColors.length),-73,0,10,this.parent.markNo);
							}
						
						chooseColors[this.parent.markNo].e138([-500,-500]);
							
						var thisTopChildLength = thisTop.child.length; 
						
						for(var thisN = 0;thisN < thisTopChildLength;thisN++){
							if(thisTop.child[thisN] == chooseColors[this.parent.markNo]){
								thisTop.child.splice(thisN,1);
								}
							}
						e175.e194(["markSign"]);
						}
					
					e179.splice(this.parent.markNo,1);
					if(e179.length == 0){ 
						e175.transform.parent = null;
						e175.e169();
						e132.e157(e175);
						
						e174.e194(["switchButton"]);
						e178 = 0;
					}
					
				}
				
				colorDeleteActive["activeOver"] = function(){
				this.e135([textures["librarySelect_del_red"]]);
				}
				
				colorDeleteActive["activeLeave"] = function(){
				this.e135([textures["librarySelect_del_white"]]);
				}
				
				var colorDeleteButton = new e132.e98("colorDeleteButton",[],[textures["librarySelect_del_white"]],[],colorDeleteActive);
				markSelect[0].e144([colorDeleteButton,0,0]);
				}
	}
	thisActivtion["activeLeave"] = function (){ 
	}
	
	var thisFrame = new e132.e98("e190",[],[],thisBgColor,thisActivtion);
	
	
	
	var longColorItem = new Array;
	
	var colorItemTexture = new Array;
		colorItemTexture[0] = textures["librarySelect_colorBg"];
	
	var colorItemActive = new Array;
	
	 longColorItem[0] = new e132.e98("longColorItem0",[],colorItemTexture,[],[]);
	 longColorItem[1] = new e132.e98("longColorItem1",[],colorItemTexture,[],[]);	
	 longColorItem[2] = new e132.e98("longColorItem2",[],colorItemTexture,[],[]);		
	
	var ii = 0;
	for(var n=0;n < e179[No].length;n++){
		var colorBlock = e132.e189();
		
		colorBlock.e136([e179[No][n][0],
								   e179[No][n][1],
								   e179[No][n][2],
								   e179[No][n][3]]);
		if(n%3 == 0){ii = n/3}
		longColorItem[n%3].e144([colorBlock,1,ii*21]);
		}
	
	var longColorItemCover = new Array;
	longColorItemCover[0] = new e132.e98("longColorItemCover",[],[textures["librarySelect_colorFrame"]],[],[]);
	longColorItemCover[1] = new e132.e98("longColorItemCover",[],[textures["librarySelect_colorFrame"]],[],[]);
	longColorItemCover[2] = new e132.e98("longColorItemCover",[],[textures["librarySelect_colorFrame"]],[],[]);
	
	longColorItem[0].e144([longColorItemCover[0],0,0])	;
	longColorItem[1].e144([longColorItemCover[1],0,0])	;
	longColorItem[2].e144([longColorItemCover[2],0,0])	;
	
	thisFrame.e144([longColorItem[0],2,0])	;
	thisFrame.e144([longColorItem[1],23,0]);
	thisFrame.e144([longColorItem[2],44,0]);

	return thisFrame;
	}


e132.e191 = function(startNo){
	var thisTexture = new Array;
	thisTexture[0] =  textures["librarySelect_bg"];
	
	e175 = new e132.e98("e191",[],thisTexture,[],[]);
	
	for( var n =0;n < e179.length ;n++){
		var thisColorUnit = e132.e190(n);
		e175.e144([thisColorUnit,(n-startNo)*73+104,24]);
		if(n>=startNo && n < startNo +7){
			thisColorUnit.e154();
			thisColorUnit.e151("longColorItem0",["e139",[1]]);
			thisColorUnit.e151("longColorItem1",["e139",[1]]);
			thisColorUnit.e151("longColorItem2",["e139",[1]]);
			}else{
				thisColorUnit.e153();
				thisColorUnit.e151("longColorItem0",["e139",[0]]);
				thisColorUnit.e151("longColorItem1",["e139",[0]]);
				thisColorUnit.e151("longColorItem2",["e139",[0]]);
				}
		}
	
	var forwordButton =  new e132.e98("forwordButton",[],[textures["librarySelect_left_gray"]],[],[]);
	var backwordButton = new e132.e98("backwordButton",[],[textures["librarySelect_right_gray"]],[],[]);
	
	var maskLeft = new e132.e98("maskLeft",[],[textures["librarySelect_leftCover"]],[],[]);
		maskLeft.e144([forwordButton,1,57]);
		maskLeft.activeDown = function(){
			if(!e177){
				if(e176 == 0){e132.tips.showBy("到头了",200);}
				if(e176 > 0){
				e176--;
				var thisTop = e132.e196(this);
				var chooseColors =  thisTop.e195(["e190"]);
					e132.e192(chooseColors,73,0,10,0);
				}
			}
			forwordButton.e135([textures["librarySelect_left_gray"]]);
			}
		maskLeft.activeOver = function(){
			e175.e194(["markSign"]);
			
			forwordButton.e135([textures["librarySelect_left_blue"]]);
			}
			
		maskLeft.activeLeave = function(){
			forwordButton.e135([textures["librarySelect_left_gray"]]);
			}
			
	
	var maskRight = new e132.e98("maskRight",[],[textures["librarySelect_rightCover"]],[],[]);
		maskRight.e144([backwordButton,4,57]);
		maskRight.activeDown = function(){
			if(!e177){
				if(e176 == e179.length -7){e132.tips.showBy("到尾了",200);}
				if(e176 < e179.length -7){
				e176++;
				var thisTop = e132.e196(this);
				var chooseColors =  thisTop.e195(["e190"]);
					e132.e192(chooseColors,-73,0,10,0);
					}
				}
			backwordButton.e135([textures["librarySelect_right_gray"]]);
			}
		maskRight.activeOver = function(){
			e175.e194(["markSign"]);
			
			backwordButton.e135([textures["librarySelect_right_blue"]]);
			}
			
		maskRight.activeLeave = function(){
			backwordButton.e135([textures["librarySelect_right_gray"]]);
			}
			
			
	
	
	e175.e144([maskLeft,75,5]);
	e175.e144([maskRight,610,5]);
	
	maskLeft.changeZ([8]);
	maskRight.changeZ([8]);
	
	
	e175.e138([80,30]);
	e175.e168(e174);
	
	}
	

e132.e192 = function(thisDialogs,xL,yL,e232,moveBoundary){
	if(!e177){
		var n = 0;
		var e232 = !e232 ? 15 : e232;
		var before = new Array;
		for (var ii = 0;ii < thisDialogs.length;ii++){
			before.push([thisDialogs[ii].x,thisDialogs[ii].y]);
			}
		
		e177 = setInterval(function(){e132.e193(thisDialogs,before,xL,yL,n,e232,moveBoundary);n++;},10);
		}
	}
	
e132.e193 = function(thisDialogs,before,xL,yL,n,e232,moveBoundary){
	for(var ii =0;ii < thisDialogs.length;ii++){
		var afterX = before[ii][0]+xL*Math.sin(n*PI/2/e232);
		thisDialogs[ii].x = afterX;
		
		if(xL < 0){
			if(ii == e176-1-moveBoundary){
				if(xL*Math.sin(n*PI/2/e232)>-30){
					thisDialogs[ii].e153();
					}else if(xL*Math.sin(n*PI/2/e232)<-30 && xL*Math.sin(n*PI/2/e232)> -50){
						thisDialogs[ii].e151("longColorItem0",["e139",[0]]);
						}else if(xL*Math.sin(n*PI/2/e232)< -50 && xL*Math.sin(n*PI/2/e232)> -70){
							thisDialogs[ii].e151("longColorItem1",["e139",[0]]);
							}else if(xL*Math.sin(n*PI/2/e232)< -70){
							thisDialogs[ii].e151("longColorItem2",["e139",[0]]);
								}
					}else if(ii == e176+6-moveBoundary){
							if( xL*Math.sin(n*PI/2/e232)> -30){
								thisDialogs[ii].e151("longColorItem0",["e139",[1]]);
								}else if(xL*Math.sin(n*PI/2/e232)< -30 && xL*Math.sin(n*PI/2/e232)> -50){
									thisDialogs[ii].e151("longColorItem1",["e139",[1]]);
									}else if(xL*Math.sin(n*PI/2/e232)< -50 && xL*Math.sin(n*PI/2/e232)> -70){
										thisDialogs[ii].e151("longColorItem2",["e139",[1]]);
										}else if(xL*Math.sin(n*PI/2/e232)< -70){
											thisDialogs[ii].e154();
											}
						}
		}
		if(xL>0){
			if(ii == e176){
				if(xL*Math.sin(n*PI/2/e232) < 30 ){
					thisDialogs[ii].e151("longColorItem2",["e139",[1]]);
					}else if(xL*Math.sin(n*PI/2/e232)>30 && xL*Math.sin(n*PI/2/e232) < 50){
						thisDialogs[ii].e151("longColorItem1",["e139",[1]]);
						}else if(xL*Math.sin(n*PI/2/e232)>50 && xL*Math.sin(n*PI/2/e232) < 70){
							thisDialogs[ii].e151("longColorItem0",["e139",[1]]);
							}else if(xL*Math.sin(n*PI/2/e232)>70){
								thisDialogs[ii].e154();
								}
				}else if(ii == e176+7){
					if(xL*Math.sin(n*PI/2/e232) < 30){
						thisDialogs[ii].e153();
						}if(xL*Math.sin(n*PI/2/e232)>30 && xL*Math.sin(n*PI/2/e232) < 50){
						thisDialogs[ii].e151("longColorItem2",["e139",[0]]);
						}else if(xL*Math.sin(n*PI/2/e232)>50 && xL*Math.sin(n*PI/2/e232) < 65){
							thisDialogs[ii].e151("longColorItem1",["e139",[0]]);
							}else if(xL*Math.sin(n*PI/2/e232)>65){
								thisDialogs[ii].e151("longColorItem0",["e139",[0]]);
								}
					}
			}
		
		var afterY = before[ii][1]+yL*Math.sin(n*PI/2/e232);
		thisDialogs[ii].y = afterY;
		thisDialogs[ii].transform.identity();
		thisDialogs[ii].transform.translate(afterX,afterY,thisDialogs[ii].z);
		if (n>=e232){
			clearInterval(e177);
			e177 = null;
			}
		}
	}
		



e132.e98.prototype.e194 = function(Param){
	var subChildName = Param[0];
	for(var n=0;n < this.child.length;n++){
		if(this.child[n].child[0]){
			this.child[n].e194([subChildName])
			}
		
		if(subChildName == this.child[n].name){
			this.child[n].transform.parent = null;
			e132.e157(this.child[n]);
			this.child.splice(n,1);
			n--;
			}
		}
	}


e132.e98.prototype.e195 = function(Param){
	var subChildName = Param[0];
	var childArray = new Array;
	for(var n=0;n < this.child.length;n++){
		if(this.child[n].child[0]){
			this.child[n].e195([subChildName])
			}
		if(subChildName == this.child[n].name){
			childArray.push(this.child[n]);
			}
		}
		return childArray;
	}


e132.e196 = function(aChild){
	var thisChildTopParent = aChild;
	if (aChild.parent){
		thisChildTopParent = e132.e196(aChild.parent);
		}
	return thisChildTopParent;
	}
	
	


e132.e197 = function(color){
	
	e17 = new e132.e98("brushColor",[],[],[[],25,25],[]);
	
	var brushColor0 = new e132.e98("brushColor",[],[],[color,5,2],[]);
	var brushColor1 = new e132.e98("brushColor",[],[],[color,9,9],[]);
	var brushColor2 = new e132.e98("brushColor",[],[],[color,3,8],[]);
	

	var bruchCover = new e132.e98("bruchCover",[],[textures["brush"]],[],[]);
	
	e17.e144([brushColor0,7,1]);
	e17.e144([brushColor1,5,3]);
	e17.e144([brushColor2,2,6]);
	
	e17.e144([bruchCover,0,0]);
	
	e17.changeZ([5000]);
	
	}







		var e220 = e220 || {};
 

e220.e198 = function(){
	e72[0] = [];
	e72[1] = [];
	e72[2] = [];
	for(var n=0;n < e63.length;n++){
		if(!e63[n][2][0]){
				e72[0].push(e63[n][2]);
				e72[1].push(e63[n][3]);
				e72[2].push(n);
				}
		}
	}

e220.e199 = function(){
	e73[0] = [];
	e73[1] = [];
	e73[2] = [];
	e73[4] = [];
	e73[2][0] = e70[4].x;
	e73[2][1] = e70[4].y;
	e73[2][2] = e70[4].z;
	e73[3] = false;
	for(var n=0;n < e63.length;n++){
		if(e63[n][2][0]){
			var martrix = [e63[n][2].localX,e63[n][2].localY,e63[n][2].localZ];
			e73[0].push(e63[n][2]);
			e73[1].push(martrix);
			e73[4].push(n);
			}
		}
	}
	
e220.e200 = function(){
	e73[0] = [];
	e73[1] = [];
	e73[2] = [];
	e73[4] = [];
	e73[2][0] = e70[4].x;
	e73[2][1] = e70[4].y;
	e73[2][2] = e70[4].z;
	e73[3] = false;
	for(var n=0;n < e63.length;n++){
			var martrix = [e63[n][2].localX,e63[n][2].localY,e63[n][2].localZ];
			e73[0].push(e63[n][2]);
			e73[1].push(martrix);
			e73[4].push(n);
		}
	}

	
e220.e201 = function(e87){
	for(var n = 0;n < e87.length;n++){
		if (e87[n][0]){
			e220.e201(e87[n]);
			}
			else{
				e68[e87[n].x][e87[n].y][e87[n].z] = null;
				}
		}
	}

e220._insertRay = function(bounding,mouseX,mouseY){
	var worldRay = o3djs.picking.clientPositionToWorldRay(
															mouseX,
															mouseY,
															e6.drawContext,
															e1.width,
															e1.height);
	var rayIntersectionInfo = bounding.intersectRay(worldRay.near,worldRay.far);
	
	return rayIntersectionInfo;
	}
	
e220.e202 = function(e87,e33,bounding,mouseX,mouseY){
	var rayIntersectionInfo = e220._insertRay(bounding,mouseX,mouseY);
	var touchX = rayIntersectionInfo.position[0];
	var touchY = rayIntersectionInfo.position[1];
	var touchZ = rayIntersectionInfo.position[2];
 	var deltaCubes;
	
	if (e33[0]){		deltaCubes = Math.round(touchX-e73[2][0]-0.5);
		}
	else if(e33[1]){	deltaCubes = Math.round(touchX-e73[2][0]+0.5);
			}
	else if(e33[2]){	deltaCubes = Math.round(touchY-e73[2][1]-0.5);
			}
	else if(e33[3]){	deltaCubes = Math.round(touchY-e73[2][1]+0.5);
			}
	else if(e33[4]){	deltaCubes = Math.round(touchZ-e73[2][2]-0.5);
			}
			else{			deltaCubes = Math.round(touchZ-e73[2][2]+0.5);
				}
	
	if(deltaCubes != e71[1]){
		
		e71[1] = deltaCubes;
		
		if(!e73[3]){
			e220.e201(e73[0]);
			e73[3] = true;
			}
		
			e220.e203(e33,deltaCubes);
			e58["moved"] = true; 
				}
	
	}
	
	
e220._touchCheckX = function(e87,delta){
	if(e87[0]){
		for(var n=0;n < e87.length;n++){
			var touchInfo = e220._touchCheckX(e87[n],delta);
			if(touchInfo){
				return true;
				}
			}
		}
		else{
			e77(e87.x + delta,e87.y);
			if(	e68[e87.x + delta][e87.y][e87.z]){
				return true;
				}
			}
	}
e220._touchCheckY = function(e87,delta){
	if(e87[0]){
		for(var n=0;n < e87.length;n++){
			var touchInfo = e220._touchCheckY(e87[n],delta);
			if(touchInfo){
				return true;
				}
			}
		}
		else{
			e77(e87.x,e87.y + delta);
			if(	e68[e87.x][e87.y + delta][e87.z]){
				return true;
				}
			}
	}
e220._touchCheckZ = function(e87,delta){
	if(e87[0]){
		for(var n=0;n < e87.length;n++){
			var touchInfo = e220._touchCheckZ(e87[n],delta);
			if(touchInfo){
				return true;
				}
			}
		}
		else{
			e77(e87.x,e87.y);
			if(	e68[e87.x][e87.y][e87.z + delta]){
				return true;
				}
			}
	}
	
	
e220._touchReCheckX = function(e87,xBeenCheck){
		var touchInfo = e220._touchCheckX(e87,xBeenCheck);
		if(!touchInfo){
			e71[2] = xBeenCheck;
			return xBeenCheck;
			}
			else if(e71[2] < xBeenCheck){
				xBeenCheck--;
				xBeenCheck = e220._touchReCheckX(e87,xBeenCheck);
				e71[2] = xBeenCheck;
				return xBeenCheck;
				}
				else{
					xBeenCheck++;
					xBeenCheck = e220._touchReCheckX(e87,xBeenCheck);
					e71[2] = xBeenCheck;
					return xBeenCheck;
					}
	}
e220._touchReCheckY = function(e87,yBeenCheck){
		var touchInfo = e220._touchCheckY(e87,yBeenCheck);
		if(!touchInfo){
			e71[2] = yBeenCheck;
			return yBeenCheck;
			}
			else if(e71[2] < yBeenCheck){
				yBeenCheck--;
				yBeenCheck = e220._touchReCheckY(e87,yBeenCheck);
				e71[2] = yBeenCheck;
				return yBeenCheck;
				}
				else{
					yBeenCheck++;
					yBeenCheck = e220._touchReCheckY(e87,yBeenCheck);
					e71[2] = yBeenCheck;
					return yBeenCheck;
					}
	}
e220._touchReCheckZ = function(e87,zBeenCheck){
		var touchInfo = e220._touchCheckZ(e87,zBeenCheck);
		if(!touchInfo){
			e71[2] = zBeenCheck;
			return zBeenCheck;
			}
			else if(e71[2] < zBeenCheck){
				zBeenCheck--;
				zBeenCheck = e220._touchReCheckZ(e87,zBeenCheck);
				e71[2] = zBeenCheck;
				return zBeenCheck;
				}
				else{
					zBeenCheck++;
					zBeenCheck = e220._touchReCheckZ(e87,zBeenCheck);
					e71[2] = zBeenCheck;
					return zBeenCheck;
					}
	}


	
e220.e203 = function(e33,deltaCubes){
	if (e33[0] || e33[1] ){
		
		e71[0] = e220._touchReCheckX(e73[0],deltaCubes);
		
		for(var n = 0;n < e73[0].length;n++){
			e73[0][n].transform.identity();
			e73[0][n].transform.translate(e73[1][n][0]+e71[0],
															e73[1][n][1], 
															e73[1][n][2]
															);
			}
	}
	else if (e33[2] || e33[3]){
		
		e71[0] = e220._touchReCheckY(e73[0],deltaCubes);
		
		for(var n = 0;n < e73[0].length;n++){
			e73[0][n].transform.identity();
			e73[0][n].transform.translate(e73[1][n][0],
															e73[1][n][1]+e71[0], 
															e73[1][n][2]
															);
			}
	}
	else {
		
		e71[0] = e220._touchReCheckZ(e73[0],deltaCubes);
					
		for(var n = 0;n < e73[0].length;n++){
			e73[0][n].transform.identity();
			e73[0][n].transform.translate(e73[1][n][0],
															e73[1][n][1], 
															e73[1][n][2]+e71[0]
															);
			}
	}
	}	
	
e220.e204 = function(e87,e33){
	for(var n = 0;n < e87.length;n++){
		
		if (e33[0]||e33[1]){
			e87[n].localX = e87[n].transform.localMatrix[3][0];
			e87[n].x = e87[n].transform.worldMatrix[3][0];
			}
		else if (e33[2]||e33[3]){
			e87[n].localY = e87[n].transform.localMatrix[3][1];
			e87[n].y = e87[n].transform.worldMatrix[3][1];
			}
		else{
			e87[n].localZ = e87[n].transform.localMatrix[3][2];
			e87[n].z = e87[n].transform.worldMatrix[3][2];
			}
			
		if (e87[n][0]){
			e220.e204(e87[n],e33);
			}
			else{
				e77(e87[n].x,e87[n].y);
				e68[e87[n].x][e87[n].y][e87[n].z] = e87[n];
				}
		}
	}
	

e220.e205 = function(e87,e33,bounding,mouseX,mouseY){
	var rayIntersectionInfo = e220._insertRay(bounding,mouseX,mouseY);
	var touchX = rayIntersectionInfo.position[0];
	var touchY = rayIntersectionInfo.position[1];
	var touchZ = rayIntersectionInfo.position[2];
 	var deltaCubes;
	
	if (e33[0]){	   		deltaCubes = Math.round(touchX-e87.x-0.5);}
	else if (e33[1]){		deltaCubes = Math.round(e87.x-touchX-0.5);}
	else if (e33[2]){		deltaCubes = Math.round(touchY-e87.y-0.5);}
	else if (e33[3]){		deltaCubes = Math.round(e87.y-touchY-0.5);}
	else if (e33[4]){		deltaCubes = Math.round(touchZ-e87.z-0.5);}
	else{						deltaCubes = Math.round(e87.z-touchZ-0.5);}
	
	if(deltaCubes != e71[1]){
		e71[1] = deltaCubes;
		if (deltaCubes > 0){
			e220.e207(e72[0],e72[1],deltaCubes);
			e58["growth"] = true; 
			e71[2] = e71[2] < deltaCubes ? deltaCubes : e71[2];
			}
			else if (deltaCubes < 0){
				e58["growth"] = true; 
				e71[0] = e71[0]>deltaCubes ? deltaCubes : e71[0];
				}
		
		e220.e216();
		e63 = [];
		
		 for (var n=0;n < e72[0].length;n++){
			 var selectCubeX = e72[0][n].x;
			 var selectCubeY = e72[0][n].y;
			 var selectCubeZ = e72[0][n].z;
			 e220.e210(	deltaCubes+1,e71[2],
										e72[1][n],
										selectCubeX,selectCubeY,selectCubeZ);
			 e220.e211(	e71[0],deltaCubes,
										e72[1][n],
										selectCubeX,selectCubeY,selectCubeZ);
			 e212(deltaCubes,e72[1][n],selectCubeX,selectCubeY,selectCubeZ);
			}
		}
	}
	

e220.e206 = function(){
	e77(e60.x,e60.y);
	if(!e68[e60.x][e60.y][e60.z]){
		var firstCube = new e220.e219(  e48[0].cubeShape,
													e60.red,
													e60.green,
													e60.blue,
													e60.alpha,
													e60.x,e60.y,e60.z,1);
		firstCube.comAndUpDataBounding();
		e62[e62.length-1].push(firstCube);
		}
		else{
			e132.tips.showBy("原始位置已经有一个方块啦，不能在同一位置生成两个方块，程序还没有改好，期待吧！",400,10);
			
			}
	}	




e220.e207 = function(e87,e33,e34){
		   for (var n=0;n < e87.length;n++){
			   e220.e209(e87[n].localX,e87[n].localY,e87[n].localZ,
							e87[n].red,e87[n].green,e87[n].blue,
							e87[n].alpha,
							e34,e33[n]);
			}
	}

e220.e208 = function(){
	if(e71[1] != e71[2]){
		var cubeClearList = new Array;
			 for (var n = 0; n < e72[0].length; n++){
				 var x = e72[0][n].x;
				 var y = e72[0][n].y;
				 var z = e72[0][n].z;
				 
				 if(e72[1][n][0]){
					 for(var num=e71[1]+1;num<=e71[2];num++){
						 if(e68[x+num][y][z]){
						 if(e68[x+num][y][z].parent == e62[e62.length-1]){
						 cubeClearList.push(e68[x+num][y][z]);
						 }
						 }
						 }
					 }
				if(e72[1][n][1]){
					 for(var num=e71[1]+1;num<=e71[2];num++){
						 if(e68[x-num][y][z]){
						 if(e68[x-num][y][z].parent == e62[e62.length-1]){
						 cubeClearList.push(e68[x-num][y][z]);
						 }
						 }
						 }
					}
				if(e72[1][n][2]){
					 for(var num=e71[1]+1;num<=e71[2];num++){
						 if(e68[x][y+num][z]){
						 if(e68[x][y+num][z].parent == e62[e62.length-1]){
						 cubeClearList.push(e68[x][y+num][z]);
						 }
						 }
						 }
					}
				if(e72[1][n][3]){
					 for(var num=e71[1]+1;num<=e71[2];num++){
						 if(e68[x][y-num][z]){
						 if(e68[x][y-num][z].parent == e62[e62.length-1]){
						 cubeClearList.push(e68[x][y-num][z]);
						 }
						 }
						 }
					}
				if(e72[1][n][4]){
					 for(var num=e71[1]+1;num<=e71[2];num++){
						 if(e68[x][y][z+num]){
						 if(e68[x][y][z+num].parent == e62[e62.length-1]){
						 cubeClearList.push(e68[x][y][z+num]);
						 }
						 }
						 }
					}
				if(e72[1][n][5]){
					 for(var num=e71[1]+1;num<=e71[2];num++){
						 if(e68[x][y][z-num]){
						 if(e68[x][y][z-num].parent == e62[e62.length-1]){
						 cubeClearList.push(e68[x][y][z-num]);
						 }
						 }
						 }
					}
				}
			e110.e116(cubeClearList);
			}
	}

	
e220.e209 = function(x,y,z,red,green,blue,cubeAlpha,e34,e33){
    if(e33[0]){
		var localX = x;
		var localY = y;
		var localZ = z;
		for(var n=0;n < e34;n++){
			var cubes = new e220.e219(e48[0].cubeShape,
													red,green,blue,cubeAlpha,
													localX+=1,localY,localZ,1);
			if(cubes.transform){
				e62[e62.length-1].push(cubes);
				}
			}
		}
    if(e33[1]){
		var localX = x;
		var localY = y;
		var localZ = z;
		for(var n=0;n < e34;n++){
			var cubes = new e220.e219(e48[0].cubeShape,
													red,green,blue,cubeAlpha,
													localX+=-1,localY,localZ,1);
			if(cubes.transform){
				e62[e62.length-1].push(cubes);
				}
			}
		}
    if(e33[2]){
		var localX = x;
		var localY = y;
		var localZ = z;
		for(var n=0;n < e34;n++){
			var cubes = new e220.e219(e48[0].cubeShape,
													red,green,blue,cubeAlpha,
													localX,localY+=1,localZ,1);
			if(cubes.transform){
				e62[e62.length-1].push(cubes);
				}
			}
		}
    if(e33[3]){
		var localX = x;
		var localY = y;
		var localZ = z;
		for(var n=0;n < e34;n++){
			var cubes = new e220.e219(e48[0].cubeShape,
													red,green,blue,cubeAlpha,
													localX,localY+=-1,localZ,1);
			if(cubes.transform){
				e62[e62.length-1].push(cubes);
				}
			}
		}
    if(e33[4]){
		var localX = x;
		var localY = y;
		var localZ = z;
		for(var n=0;n < e34;n++){
			var cubes = new e220.e219(e48[0].cubeShape,
													red,green,blue,cubeAlpha,
													localX,localY,localZ+=1,1);
			if(cubes.transform){
				e62[e62.length-1].push(cubes);
				}
			}
		}
    if(e33[5]){
		var localX = x;
		var localY = y;
		var localZ = z;
		for(var n=0;n < e34;n++){
			var cubes = new e220.e219(e48[0].cubeShape,
													red,green,blue,cubeAlpha,
													localX,localY,localZ+=-1,1);
			if(cubes.transform){
				e62[e62.length-1].push(cubes);
				}
			}
		}
	
	}
	
e220.e210 = function(hideStart,hideEnd,e33,x,y,z){
	var thisCube;
	for (var n = hideStart;n <= hideEnd;n++ ){
		if (e33[0]){
			e77(x+n,y);
			thisCube = e68[x+n][y][z];
			if (thisCube){
				if(thisCube.parent == e62[e62.length-1]){
				thisCube.transform.parent = null;
				}
				}
				}
				
		if(e33[1]){
			e77(x-n,y);
			thisCube = e68[x-n][y][z];
			if(thisCube){
				if(thisCube.parent == e62[e62.length-1]){
				thisCube.transform.parent = null;
				}
				}
				}
				
		if(e33[2]){
			e77(x,y+n);
			thisCube = e68[x][y+n][z];
			if (thisCube){
				if(thisCube.parent == e62[e62.length-1]){
				thisCube.transform.parent = null;
				}
				}
				}
				
		if(e33[3]){
			e77(x,y-n);
			thisCube = e68[x][y-n][z];
			if (thisCube){
				if(thisCube.parent == e62[e62.length-1]){
				thisCube.transform.parent = null;
				}
				}
				}
		if(e33[4]){	
			e77(x,y);
			thisCube = e68[x][y][z+n];
			if(thisCube){
				if(thisCube.parent == e62[e62.length-1]){
				thisCube.transform.parent = null;	
				}
				}
				}
		if(e33[5]){
			e77(x,y);
			thisCube = e68[x][y][z-n];
			if(thisCube){
				if(thisCube.parent == e62[e62.length-1]){
				thisCube.transform.parent = null;
				}
				}
				}
		}
	}
	
e220.e211 = function(showStart,showEnd,e33,x,y,z){
	var thisCube;
	for (var n = showStart;n <= showEnd;n++ ){
		if (e33[0]){
			e77(x+n,y);
			thisCube = e68[x+n][y][z];
			if(thisCube){
				if(thisCube.parent == e62[e62.length-1]){
				thisCube.transform.parent = e62[e62.length-1].transform;
				}
				}
				}
				
		if(e33[1]){
			e77(x-n,y);
			thisCube = e68[x-n][y][z];
			if(thisCube){
				if(thisCube.parent == e62[e62.length-1]){
				thisCube.transform.parent = e62[e62.length-1].transform;
				}
				}
				}
				
		if(e33[2]){
			e77(x,y+n);
			thisCube = e68[x][y+n][z];
			if(thisCube){
				if(thisCube.parent == e62[e62.length-1]){
				thisCube.transform.parent = e62[e62.length-1].transform;
				}
				}
				}
		if(e33[3]){
			e77(x,y-n);
			thisCube = e68[x][y-n][z];
			if(thisCube){
				if(thisCube.parent == e62[e62.length-1]){
				thisCube.transform.parent = e62[e62.length-1].transform;
				}
				}
				}
		if(e33[4]){
			e77(x,y);
			thisCube = e68[x][y][z+n];
			if(thisCube){
				if(thisCube.parent == e62[e62.length-1]){
				thisCube.transform.parent = e62[e62.length-1].transform;
				}
				}
				}
				
		if(e33[5]){
			e77(x,y);
			thisCube = e68[x][y][z-n];
			if(thisCube){
				if(thisCube.parent == e62[e62.length-1]){
				thisCube.transform.parent = e62[e62.length-1].transform;
				}
				}
				}
		}
	}
	
	
function e212(deltaCubes,e33,x,y,z){
		if(e33[0]){
			var shiftX = x+deltaCubes;
			e110.e257(shiftX,y,z,[true,false,false,false,false,false]);
			}
		if(e33[1]){
			var shiftX = x-deltaCubes;
			e110.e257(shiftX,y,z,[false,true,false,false,false,false]);
			}
		if(e33[2]){
			var shiftY = y+deltaCubes;
			e110.e257(x,shiftY,z,[false,false,true,false,false,false]);
			}
		if(e33[3]){
			var shiftY = y-deltaCubes;
			e110.e257(x,shiftY,z,[false,false,false,true,false,false]);
			}
		if(e33[4]){
			var shiftZ = z+deltaCubes;
			e110.e257(x,y,shiftZ,[false,false,false,false,true,false]);
			}
		if(e33[5]){
			var shiftZ = z-deltaCubes;
			e110.e257(x,y,shiftZ,[false,false,false,false,false,true]);
			}
		}



e220.e213 = function(	frameShape,planShape,
									colorRed,colorGreen,colorBlue,frameAlpha,
									selectCube,directionArray,scaleL){
	if (selectCube[0]){
		for(var n=0;n < selectCube.length;n++){
			e220.e213(frameShape,planShape,
								   colorRed,colorGreen,colorBlue,frameAlpha,
								   selectCube[n],directionArray,scaleL);
			}
		}
		else{
			selectCube.wireFrame = new e220.e214(	frameShape,planShape,
																	colorRed,colorGreen,colorBlue,frameAlpha,
																	selectCube,directionArray,scaleL);
			}
	}
	
e220.e214 = function(	frameShape,planShape,
										colorRed,colorGreen,colorBlue,frameAlpha,
										selectCube,directionArray,scaleL){
	
		this.red = colorRed;
		this.green = colorGreen;
		this.blue = colorBlue;
		this.alpha = frameAlpha;
		this.parent = selectCube;
		
		this.transform = e4.createObject("Transform");
		this.transform.parent = selectCube.transform;
		this.transform.addShape(frameShape);
		this.transform.scale(scaleL,
							 scaleL,
							 scaleL);
		
		if(directionArray){
		var rad = PI/2;
		this.transformPlanArray = new Array;
			if(directionArray[0]){
				var newPlan = this.e215([0,rad,0],[0.02,0,0],planShape,this.transform);
				this.transformPlanArray[0] = newPlan;
				}
			if(directionArray[1]){
				var newPlan = this.e215([0,-rad,0],[-0.02,0,0],planShape,this.transform);
				this.transformPlanArray[1] = newPlan;
				}
			if(directionArray[2]){
				var newPlan = this.e215([-rad,0,0],[0,0.02,0],planShape,this.transform);
				this.transformPlanArray[2] = newPlan;
				}
			if(directionArray[3]){
				var newPlan = this.e215([rad,0,0],[0,-0.02,0],planShape,this.transform);
				this.transformPlanArray[3] = newPlan;
				}
			if(directionArray[4]){
				var newPlan = this.e215([0,0,0],[0,0,0.02],planShape,this.transform);
				this.transformPlanArray[4] = newPlan;
				}
			if(directionArray[5]){
				var newPlan = this.e215([0,PI,0],[0,0,-0.02],planShape,this.transform);
				this.transformPlanArray[5] = newPlan;
				}
			}
	}

e220.e214.prototype.e215 = function (selectDir,selectTra,
															 planShape,parent){
	var transform = e4.createObject("Transform");
	transform.parent = parent;
	transform.addShape(planShape);
	transform.translate(selectTra);
	transform.rotateZYX(selectDir);	
	transform.createParam("diffuse","ParamFloat4").value = [1,1,1,1];
	return transform
	}

	
e220.e216 = function(){
	if(e63[0]){
		for(var n = 0;n < e63.length;n++){
			e220.clearWireFrame(n);
			}
		}
	}
	
e220.clearWireFrame = function(num){
	if(e63[num] && e63[num][2][0]){
		var subClearMass = e63[num][2];
		for(var n=0;n < subClearMass.length;n++){
			e220._clearFrames(subClearMass[n]);
			}
		}
		else if(e63[num] && e63[num][2].wireFrame){
				e63[num][2].wireFrame.transform.parent = null;
				e63[num][2].wireFrame = null;
				}
	}	



e220._clearFrames = function(e87){
	if(e87[0]){
		for(var n=0;n < e87.length;n++){
			e220._clearFrames(e87[n]);
			}
		}else if(e87.wireFrame){
			e87.wireFrame.transform.parent = null;
			e87.wireFrame = null;
			}
	}

	
e220.e217 = function(red,green,blue,alpha){
	this.effect = e4.createObject("Effect");
	this.shaders = o3djs.debug.createColorShaders_(O3D_DEBUG_COLOR_PARAM_NAME);
	this.effect.loadFromFXString(this.shaders);
	
	this.material = e4.createObject("Material");
	this.material.effect = this.effect;
	this.material.drawList = e6.zOrderedDrawList;
	this.effect.createUniformParameters(this.material);
	
	this.material.getParam(O3D_DEBUG_COLOR_PARAM_NAME).value = [red,green,blue,alpha];
	this.color = this.material.getParam(O3D_DEBUG_COLOR_PARAM_NAME);
	var a = 1/2;
	var verticesArray = [
						 -a, +a, +a,
						 +a, +a, +a,
						 -a, -a, +a,
						 +a, -a, +a,
						 -a, +a, -a,
						 +a, +a, -a,
						 -a, -a, -a,
						 +a, -a, -a
						 ];
	var indicesArray = [
						0,1,
						1,3,
						3,2,
						2,0,
						0,4,
						1,5,
						3,7,
						2,6,
						4,5,
						5,7,
						7,6,
						6,4
						];
	
	this.streamBank = e4.createObject("StreamBank");
	this.primitive = e4.createObject("Primitive");
	this.frameShape = e4.createObject("Shape");	
	this.vertexBuffer = e4.createObject("VertexBuffer");
	
	this.positionField = this.vertexBuffer.createField("FloatField",3);
	this.vertexBuffer.set(verticesArray);
	
	this.primitive.owner = this.frameShape
	this.primitive.createDrawElement(e4,null);
	this.primitive.streamBank = this.streamBank;
	this.primitive.material = this.material;
	this.primitive.numberVertices = 8;
	this.primitive.numberPrimitives = 12;
	this.primitive.primitiveType = e3.Primitive.LINELIST;
	
	this.streamBank.setVertexStream(e3.Stream.POSITION,
									0,
									this.positionField,
									0);
	this.indexBuffer = e4.createObject("IndexBuffer");
	this.indexBuffer.set(indicesArray);
	this.primitive.indexBuffer = this.indexBuffer;
	
	}
	
	
e220.e218 = function(){
	this.planMaterial = e4.createObject("Material");
	this.planMaterial.drawList = e6.zOrderedDrawList; 
	this.planMaterial.createParam("diffuse","ParamFloat4").value = [1,1,1,1];
	
	this.planMaterial.createParam('emissive', 'ParamFloat4').value = [0, 0, 0, 1]; 
	this.planMaterial.createParam('ambient', 'ParamFloat4').value = [1, 1, 1, 1];
	this.planMaterial.createParam('specular', 'ParamFloat4').value = [1, 1, 1, 1];
	this.planMaterial.createParam('shininess', 'ParamFloat').value = 50;
	this.planMaterial.createParam('specularFactor', 'ParamFloat').value = 1;
	
	this.planMaterial.createParam('lightColor', 'ParamFloat4').value = [1, 1, 1, 1]; 
	this.lightPositionParam = this.planMaterial.createParam('lightWorldPos', 'ParamFloat3'); 
	this.lightPositionParam.value = e51;
	
	this.record = o3djs.effect.buildStandardShaderString(this.planMaterial,"lambert"); 
	this.effect = e4.createObject("Effect");
	this.effect.name = this.record.description;
	this.effect.loadFromFXString(this.record.shader);
	this.planMaterial.effect = this.effect;
	this.effect.createUniformParameters(this.planMaterial); 

	var a = 1/2;
	this.positionArray = [  -a, +a, +a,
 						     +a, +a, +a,
							 -a, -a, +a,
     						 +a, -a, +a
							 ];
	
	this.normalArray = [	    0, 0, 1,
								0, 0, 1,
								0, 0, 1,
								0, 0, 1
								];

	this.indicesArray = [	  0, 2, 1,
							  2, 3, 1
							  ];

	this.planShape = e4.createObject("Shape");
	this.planPrimitive = e4.createObject("Primitive");
	this.streamBank = e4.createObject("StreamBank");
	
	this.planPrimitive.material = this.planMaterial;
	this.planPrimitive.owner = this.planShape;
	this.planPrimitive.streamBank = this.streamBank;
	
	this.planPrimitive.primitiveType = e3.Primitive.TRIANGLELIST;
	this.planPrimitive.numberPrimitives = 2;
	this.planPrimitive.numberVertices = 4;
	this.planPrimitive.createDrawElement(e4,null);
	
	this.positionBuffer = e4.createObject("VertexBuffer");
	this.positionField = this.positionBuffer.createField("FloatField",3);
	this.streamBank.setVertexStream(
									e3.Stream.POSITION,
									0,
									this.positionField,
									0);
	this.normalField = this.positionBuffer.createField("FloatField",3);
	this.streamBank.setVertexStream(
									e3.Stream.NORMAL,
									0,
									this.normalField,
									0);
 
    this.positionBuffer.allocateElements(4); 	
	
	this.positionField.setAt(0,this.positionArray);
	this.normalField.setAt(0,this.normalArray);
	
	this.indexBuffer = e4.createObject("IndexBuffer");
	this.indexBuffer.set(this.indicesArray);
	this.planPrimitive.indexBuffer = this.indexBuffer;
	



	}
	
e220.e218.prototype.e255 = function(){
	this.lightPositionParam.value = e51;
	}
	
	
	
e220.e219 = function(cubeShape,colorRed,colorGreen,colorBlue,cubeAlpha,localX,localY,localZ,localL){
	
	var parent = e62[e62.length-1];
	var worldX = parent.x+localX;
	var worldY = parent.y+localY;
	var worldZ = parent.z+localZ;
	
	e77(worldX, worldY);
    if (!e68[worldX][worldY][worldZ]){
		this.red = colorRed;
		this.green = colorGreen;
		this.blue = colorBlue;
		this.alpha = cubeAlpha;
		this.x = worldX;
		this.y = worldY;
		this.z = worldZ;
		
		this.l = localL
		this.localX = localX;
		this.localY = localY;
		this.localZ = localZ;
		
		this.parent = e62[e62.length-1];
		this.transform = e4.createObject("Transform");
		this.transform.parent = e62[e62.length-1].transform;
		this.transform.addShape(cubeShape);
		this.transform.translate(localX,
								 localY,
								 localZ);
		this.transform.scale(localL,
							 localL,
							 localL);
		this.transform.createParam("diffuse","ParamFloat4").value = [
																	 this.red,
																	 this.green,
																	 this.blue,
																	 this.alpha
																	 ];
		e68[worldX][worldY][worldZ] = this;
		}
	}
e220.e219.prototype.upDataCoor = function (){
	this.upDataX();
	this.upDataY();
	this.upDataZ();
	
	this.upDataLocalX();
	this.upDataLocalY();
	this.upDataLocalZ();
	
	}
	
e220.e219.prototype.upDataX = function (){
	this.x = this.transform.worldMatrix[3][0];
	}
e220.e219.prototype.upDataY = function (){
	this.y = this.transform.worldMatrix[3][1];
	}
e220.e219.prototype.upDataZ = function (){
	this.z = this.transform.worldMatrix[3][2];
	}
e220.e219.prototype.upDataL = function (){
	this.l = this.transform.worldMatrix[0][0];
	}
e220.e219.prototype.upDataLocalX = function (){
	this.localX = this.transform.localMatrix[3][0];
	}
e220.e219.prototype.upDataLocalY = function (){
	this.localY = this.transform.localMatrix[3][1];
	}
e220.e219.prototype.upDataLocalZ = function (){
	this.localZ = this.transform.localMatrix[3][2];
	}
e220.e219.prototype.upDataLocalL = function (){
	this.localL = this.transform.localMatrix[0][0];
	}
e220.e219.prototype.comBounding = function(){
	this.boundingBox = this.transform.shapes[0].elements[0].getBoundingBox(0).mul(this.transform.worldMatrix);
	}
e220.e219.prototype.comAndUpDataBounding = function(){
	
	this.boundingBox = this.transform.shapes[0].elements[0].getBoundingBox(0).mul(this.transform.worldMatrix);
	e220.e262(this);
	}
	
e220.e219.prototype.e221 = function(r,g,b,alpha){
	this.red = r;
	this.green = g;
	this.blue = b;
	this.alpha = alpha;
	this.transform.getParam("diffuse").value = [r,g,b,alpha];
	
	var red = Math.round(r*255);
	var green = Math.round(g*255);
	var blue = Math.round(b*255);
	var alpha = Math.round(alpha*255);
	var used;
	for(var n=0;n < e61.length;n++){
		if(	red==e61[n][0][0] &&
			green==e61[n][0][1] &&
			blue==e61[n][0][2] &&
			alpha==e61[n][0][3]){
											e61[n][1]++;
											used = true;
											if(n && e61[n][1]>e61[n-1][1]){
												var tran = e61[n-1];
												e61[n-1] = e61[n];
												e61[n] = tran;
												}
											}
		}
	if(!used){
		e61.push([[red,green,blue,alpha],1]);
		}
				var findFrames = e174.e195(["colorOftenFrame"]);
				var theLibrary = findFrames[0].e195(["colorOften"]);
			
				if(e61.length != theLibrary[0].child.length){
					var ii = (e61.length-1 - (e61.length-1)%3)/3;
					if(e61.length<=9){	
						var colorBlock = e132.e183();
						theLibrary[0].e144([colorBlock,(e61.length-1)%3*25+1,ii*25+1]);
						}
					}
				for(var k=0;k < e61.length && k < 9;k++){
					theLibrary[0].child[k].e136([e61[k][0][0]/255,
														  e61[k][0][1]/255,
														  e61[k][0][2]/255,
														  e61[k][0][3]/255]);
										}
		
	}

e220.e262 = function(e87){
	
	if (e87.parent != e9){
		e87.parent.boundingBox = 	e87.parent.boundingBox ? 
									e87.parent.boundingBox.add(e87.boundingBox) :
									e87.boundingBox;
		e220.e262(e87.parent);
		}
	}
	
e220.e222 = function(){
	this.cubeMaterial = e4.createObject("Material");
	this.cubeMaterial.drawList = e6.zOrderedDrawList; 
	this.cubeMaterial.createParam("diffuse","ParamFloat4").value = [1,1,1,1];
	
	this.cubeMaterial.createParam('emissive', 'ParamFloat4').value = [0, 0, 0, 1]; 
	this.cubeMaterial.createParam('ambient', 'ParamFloat4').value = [0, 0, 0, 1];
	this.cubeMaterial.createParam('specular', 'ParamFloat4').value = [1, 1, 1, 1];
	this.cubeMaterial.createParam('shininess', 'ParamFloat').value = 100;
	this.cubeMaterial.createParam('specularFactor', 'ParamFloat').value = 0.25;
	
	this.cubeMaterial.createParam('lightColor', 'ParamFloat4').value = [1, 1, 1, 1]; 
	this.lightPositionParam = this.cubeMaterial.createParam('lightWorldPos', 'ParamFloat3'); 
	this.lightPositionParam.value = e51;
	
	this.record = o3djs.effect.buildStandardShaderString(this.cubeMaterial,"phong"); 
	this.effect = e4.createObject("Effect");
	this.effect.name = this.record.description;
	this.effect.loadFromFXString(this.record.shader);
	this.cubeMaterial.effect = this.effect;
	this.effect.createUniformParameters(this.cubeMaterial); 

	var a = 1/2;
	this.positionArray = [	 -a, +a, +a,
 						     +a, +a, +a,
							 -a, -a, +a,
     						 +a, -a, +a,
 						     +a, +a, +a,
 						     +a, +a, -a,
 						     +a, -a, +a,
 						     +a, -a, -a,
 						     +a, +a, -a,
 						     -a, +a, -a,
 						     +a, -a, -a,
 						     -a, -a, -a,
 						     -a, +a, -a,
 						     -a, +a, +a,
 						     -a, -a, -a,
 						     -a, -a, +a,
 						     -a, +a, -a,
 						     +a, +a, -a,
 						     -a, +a, +a,
 						     +a, +a, +a,
 						     -a, -a, +a,
 						     +a, -a, +a,
 						     -a, -a, -a,
 						     +a, -a, -a
							 ];
	
	this.normalArray = [	    0, 0, 1,
								0, 0, 1,
								0, 0, 1,
								0, 0, 1,
								1, 0, 0,
								1, 0, 0,
								1, 0, 0,
								1, 0, 0,
								0, 0,-1,
								0, 0,-1,
								0, 0,-1,
								0, 0,-1,
							   -1, 0, 0,
							   -1, 0, 0,
							   -1, 0, 0,
							   -1, 0, 0,
							    0, 1, 0,
							    0, 1, 0,
							    0, 1, 0,
							    0, 1, 0,
							    0,-1, 0,
							    0,-1, 0,
							    0,-1, 0,
							    0,-1, 0
								];

	this.indicesArray = [	  0, 2, 1,
							  2, 3, 1,
							  4, 6, 5, 
							  6, 7, 5,
							  8, 10,9,
							  10,11,9,
							  12,14,13, 
							  14,15,13,
							  16,18,17, 
							  18,19,17, 
							  20,22,21, 
							  22,23,21
							  ];
	
	this.cubeShape = e4.createObject("Shape");
	this.cubePrimitive = e4.createObject("Primitive");
	this.streamBank = e4.createObject("StreamBank");
	
	this.cubePrimitive.material = this.cubeMaterial;
	this.cubePrimitive.owner = this.cubeShape;
	this.cubePrimitive.streamBank = this.streamBank;
	
	this.cubePrimitive.primitiveType = e3.Primitive.TRIANGLELIST;
	this.cubePrimitive.numberPrimitives = 12;
	this.cubePrimitive.numberVertices = 24;
	this.cubePrimitive.createDrawElement(e4,null);
	
	this.positionBuffer = e4.createObject("VertexBuffer");
	this.positionField = this.positionBuffer.createField("FloatField",3);
	this.streamBank.setVertexStream(
									e3.Stream.POSITION,
									0,
									this.positionField,
									0);
	this.normalField = this.positionBuffer.createField("FloatField",3);
	this.streamBank.setVertexStream(
									e3.Stream.NORMAL,
									0,
									this.normalField,
									0);
 
    this.positionBuffer.allocateElements(24); 	
	
	this.positionField.setAt(0,this.positionArray);
	this.normalField.setAt(0,this.normalArray);
	
	this.indexBuffer = e4.createObject("IndexBuffer");
	this.indexBuffer.set(this.indicesArray);
	this.cubePrimitive.indexBuffer = this.indexBuffer;
	
	
	
	
	}

e220.e222.prototype.e255 = function(){
	 this.lightPositionParam.value = e51;
	}
	


e220.e263 = function(red,green,blue,alpha){
	this.arrowMaterial = e4.createObject("Material");
	this.arrowMaterial.drawList = e6.zOrderedDrawList; 
	this.arrowMaterial.createParam("diffuse","ParamFloat4").value = [1,1,1,1];
	
	this.arrowMaterial.createParam('emissive', 'ParamFloat4').value = [0, 0, 0, 1]; 
	this.arrowMaterial.createParam('ambient', 'ParamFloat4').value = [0, 0, 0, 1];
	this.arrowMaterial.createParam('specular', 'ParamFloat4').value = [1, 1, 1, 1];
	this.arrowMaterial.createParam('shininess', 'ParamFloat').value = 100;
	this.arrowMaterial.createParam('specularFactor', 'ParamFloat').value = 1;
	
	this.arrowMaterial.createParam('lightColor', 'ParamFloat4').value = [1, 1, 1, 1]; 
	this.lightPositionParam = this.arrowMaterial.createParam('lightWorldPos', 'ParamFloat3'); 
	this.lightPositionParam.value = e51;
	
	this.record = o3djs.effect.buildStandardShaderString(this.arrowMaterial,"phong"); 
	this.effect = e4.createObject("Effect");
	this.effect.name = this.record.description;
	this.effect.loadFromFXString(this.record.shader);
	this.arrowMaterial.effect = this.effect;
	this.effect.createUniformParameters(this.arrowMaterial); 
	
	var lineL = 1;
	var arrowL = 0.618;
	var overL = 0.2;
	
	this.arrowShape = o3djs.primitives.createTruncatedCone(
										e4,
										this.arrowMaterial,
										0.1,   
										0.0,   
										arrowL,   
										16,    
										10);   
	this.lineShape = o3djs.primitives.createCylinder(
										e4,
										this.arrowMaterial,
										0.02,   
										lineL+overL,   
										16,    
										10);   
	
	this.transform = e4.createObject("Transform");
	this.transform.parent = null;
	
	this.transformRot = e4.createObject("Transform");
	this.transformRot.parent = this.transform;
	
	this.transform_0 = e4.createObject("Transform");
	this.transform_0.parent = this.transformRot;
	
	this.arrowTransform_0_Move = e4.createObject("Transform");
	this.arrowTransform_0_Move.parent = this.transform_0;
	
	this.arrowTransform_0 = e4.createObject("Transform");
	this.arrowTransform_0.parent = this.arrowTransform_0_Move;
	this.arrowTransform_0.addShape(this.arrowShape);
	this.arrowTransform_0.createParam("diffuse","ParamFloat4").value = [red,green,blue,alpha];
	this.arrowTransform_0.translate(0,-lineL-arrowL/2-1,0);
	this.arrowTransform_0.rotateZ(PI);
	
	this.lineTransform_0 = e4.createObject("Transform");
	this.lineTransform_0.parent = this.transform_0;
	this.lineTransform_0.addShape(this.lineShape);
	this.lineTransform_0.createParam("diffuse","ParamFloat4").value = [red,green,blue,alpha];
	this.lineTransform_0.translate(0,-(lineL+overL)/2-1,0);
	this.lineTransform_0.rotateZ(PI);
	
	
	this.transform_1 = e4.createObject("Transform");
	this.transform_1.parent = this.transformRot;
	
	this.arrowTransform_1_Move = e4.createObject("Transform");
	this.arrowTransform_1_Move.parent = this.transform_1;

	this.arrowTransform_1 = e4.createObject("Transform");
	this.arrowTransform_1.parent = this.arrowTransform_1_Move;
	this.arrowTransform_1.addShape(this.arrowShape);
	this.arrowTransform_1.createParam("diffuse","ParamFloat4").value = [red,green,blue,alpha];
	this.arrowTransform_1.translate(0,lineL+arrowL/2,0);
	
	this.lineTransform_1 = e4.createObject("Transform");
	this.lineTransform_1.parent = this.transform_1;
	this.lineTransform_1.addShape(this.lineShape);
	this.lineTransform_1.createParam("diffuse","ParamFloat4").value = [red,green,blue,alpha];
	this.lineTransform_1.translate(0,(lineL+overL)/2,0);
	}
	
e220.e263.prototype.e255 = function(){
	 this.lightPositionParam.value = e51;
	}

e220.e263.prototype.clear = function(parent){
	this.visible = false;
	this.transform.parent = null;
	}
	
e220.e263.prototype.e264 = function(e228,delta){
	this.transform.identity();
	var deltaXYZ = e228[1].position;
	if(e228[3][0]){			deltaXYZ[0]+=delta;}
	else if(e228[3][1]){	deltaXYZ[0]+=delta;}
	else if(e228[3][2]){	deltaXYZ[1]+=delta;}
	else if(e228[3][3]){	deltaXYZ[1]+=delta;}
	else if(e228[3][4]){	deltaXYZ[2]+=delta;}
	else{						deltaXYZ[2]+=delta;}
	this.transform.translate(deltaXYZ[0],deltaXYZ[1],deltaXYZ[2]);
	}
	
e220.e263.prototype.e265 = function(e228,includeAll){
	this.visible = true;
			this.transform.parent = e9.transform;
			this.transform.identity();
			this.transformRot.identity();
			this.transform_0.identity();
			this.transform_1.identity();
			
			
			
			if(includeAll){
				var allSelected = [];
				for(var n=0;n < e63.length;n++){
					allSelected.push(e63[n][2]);
					}
				var deltaL = this.e223(allSelected,e228[4],e228[3]);
				}
			else{
				var deltaL = this.e223(e228[2],e228[4],e228[3]);
				}
			this.transform_0.translate(0,deltaL,0);
			
			var deltaXYZ = e228[1].position;
			this.transform.translate(deltaXYZ[0],deltaXYZ[1],deltaXYZ[2]);
			
			if(e228[3][0]){
				this.transformRot.rotateZ(-PI/2);
				}
			else if(e228[3][1]){
				this.transformRot.rotateZ(PI/2);
				}
			else if(e228[3][3]){
				this.transformRot.rotateZ(PI);
				}
			else if(e228[3][4]){
				this.transformRot.rotateX(PI/2);
				}
			else if(e228[3][5]){
				this.transformRot.rotateX(-PI/2);
				}
	}

e220.e263.prototype.e223 = function(e87,cube,e33){
	if(e33[0]){		return this._findFarCube_X(e87,cube.y,cube.z)-cube.x;}
	else if(e33[1]){	return cube.x-this._findFarCube_nX(e87,cube.y,cube.z);}
	else if(e33[2]){	return this._findFarCube_Y(e87,cube.x,cube.z)-cube.y;}
	else if(e33[3]){	return cube.y-this._findFarCube_nY(e87,cube.x,cube.z);}
	else if(e33[4]){	return this._findFarCube_Z(e87,cube.x,cube.y)-cube.z;}
	else{					return cube.z-this._findFarCube_nZ(e87,cube.x,cube.y);}
	
	}

e220.e263.prototype._findFarCube_X = function(e87,y,z){
	var value;
	var temp;
	for(var n=0;n < e87.length;n++){
			if(e87[n][0]){
				temp = this._findFarCube_X(e87[n],y,z);
				value = value==undefined ? temp : value;
				value = value>temp ? temp : value;
				}
				else if(e87[n].y==y && e87[n].z==z){
						value = value==undefined ? e87[n].x : value;
						value = value>e87[n].x ? e87[n].x : value;
						}
		}
	return value;
	}
	
e220.e263.prototype._findFarCube_nX = function(e87,y,z){
	var value;
	var temp;
	for(var n=0;n < e87.length;n++){
			if(e87[n][0]){
				temp = this._findFarCube_nX(e87[n],y,z);
				value = value==undefined ? temp : value;
				value = value < temp ? temp : value;
				}
				else if(e87[n].y==y && e87[n].z==z){
						value = value==undefined ? e87[n].x : value;
						value = value < e87[n].x ? e87[n].x : value;
						}
		}
	return value;
	}
	
e220.e263.prototype._findFarCube_Y = function(e87,x,z){
	var value;
	var temp;
	for(var n=0;n < e87.length;n++){
			if(e87[n][0]){
				temp = this._findFarCube_Y(e87[n],x,z);
				value = value==undefined ? temp : value;
				value = value>temp ? temp : value;
				}
				else if(e87[n].x==x && e87[n].z==z){
						value = value==undefined ? e87[n].y : value;
						value = value>e87[n].y ? e87[n].y : value;
						}
		}
	return value;
	}
e220.e263.prototype._findFarCube_nY = function(e87,x,z){
	var value;
	var temp;
	for(var n=0;n < e87.length;n++){
			if(e87[n][0]){
				temp = this._findFarCube_nY(e87[n],x,z);
				value = value==undefined ? temp : value;
				value = value < temp ? temp : value;
				}
				else if(e87[n].x==x && e87[n].z==z){
						value = value==undefined ? e87[n].y : value;
						value = value < e87[n].y ? e87[n].y : value;
						}
		}
	return value;
	}
e220.e263.prototype._findFarCube_Z = function(e87,x,y){
	var value;
	var temp;
	for(var n=0;n < e87.length;n++){
			if(e87[n][0]){
				temp = this._findFarCube_Z(e87[n],x,y);
				value = value==undefined ? temp : value;
				value = value>temp ? temp : value;
				}
				else if(e87[n].x==x && e87[n].y==y){
						value = value==undefined ? e87[n].z : value;
						value = value>e87[n].z ? e87[n].z : value;
						}
		}
	return value;
	}
e220.e263.prototype._findFarCube_nZ = function(e87,x,y){
	var value;
	var temp;
	for(var n=0;n < e87.length;n++){
			if(e87[n][0]){
				temp = this._findFarCube_nZ(e87[n],x,y);
				value = value==undefined ? temp : value;
				value = value < temp ? temp : value;
				}
				else if(e87[n].x==x && e87[n].y==y){
						value = value==undefined ? e87[n].z : value;
						value = value < e87[n].z ? e87[n].z : value;
						}
		}
	return value;
	}


e220.e67 = function(red,green,blue,alpha){
	
	
	this.arrowMaterial = e4.createObject("Material");
	this.arrowMaterial.drawList = e6.zOrderedDrawList; 
	this.arrowMaterial.createParam("diffuse","ParamFloat4").value = [1,1,1,1];
	
	this.arrowMaterial.createParam('emissive', 'ParamFloat4').value = [0, 0, 0, 1]; 
	this.arrowMaterial.createParam('ambient', 'ParamFloat4').value = [0, 0, 0, 1];
	this.arrowMaterial.createParam('specular', 'ParamFloat4').value = [1, 1, 1, 1];
	this.arrowMaterial.createParam('shininess', 'ParamFloat').value = 100;
	this.arrowMaterial.createParam('specularFactor', 'ParamFloat').value = 1;
	
	this.arrowMaterial.createParam('lightColor', 'ParamFloat4').value = [1, 1, 1, 1]; 
	this.lightPositionParam = this.arrowMaterial.createParam('lightWorldPos', 'ParamFloat3'); 
	this.lightPositionParam.value = e51;
	
	this.record = o3djs.effect.buildStandardShaderString(this.arrowMaterial,"phong"); 
	this.effect = e4.createObject("Effect");
	this.effect.name = this.record.description;
	this.effect.loadFromFXString(this.record.shader);
	this.arrowMaterial.effect = this.effect;
	this.effect.createUniformParameters(this.arrowMaterial); 
	
	var lineL = 0.5;
	var arrowL = 0.5;
	var cubeL = 0.20;
	var overL = 0.03;
	
	this.arrowShape = o3djs.primitives.createTruncatedCone(
														e4,
														this.arrowMaterial,
														0.1,   
														0.0,   
														arrowL,   
														16,    
														10);   
	this.lineShape = o3djs.primitives.createCylinder(
													e4,
													this.arrowMaterial,
													0.02,   
													lineL,   
													16,    
													10);   
	
	
	this.cubeShape = o3djs.primitives.createCube(
												 e4,
												 this.arrowMaterial,
												 cubeL);
	
	this.transform = e4.createObject("Transform");
	this.transform.parent = null;
	
	this.transformRot = e4.createObject("Transform");
	this.transformRot.parent = this.transform;
	
	this.transform_0 = e4.createObject("Transform");
	this.transform_0.parent = this.transformRot;
		
		this.arrowTransform_0 = e4.createObject("Transform");
		this.arrowTransform_0.parent = this.transform_0;
		this.arrowTransform_0.addShape(this.arrowShape);
		this.arrowTransform_0.createParam("diffuse","ParamFloat4").value = [red,green,blue,alpha];
		this.arrowTransform_0.translate(0,overL+arrowL*1.5+lineL,0);
		
		
		this.arrowTransform_1 = e4.createObject("Transform");
		this.arrowTransform_1.parent = this.transform_0;
		this.arrowTransform_1.addShape(this.arrowShape);
		this.arrowTransform_1.createParam("diffuse","ParamFloat4").value = [red,green,blue,alpha];
		this.arrowTransform_1.translate(0,overL+arrowL/2,0);
		this.arrowTransform_1.rotateZ(PI);
		
		this.lineTransform = e4.createObject("Transform");
		this.lineTransform.parent = this.transform_0;
		this.lineTransform.addShape(this.lineShape);
		this.lineTransform.createParam("diffuse","ParamFloat4").value = [red,green,blue,alpha];
		this.lineTransform.translate(0,overL+arrowL+lineL/2,0);
	
	this.cubeTransform = e4.createObject("Transform");
	this.cubeTransform.parent = null;
	this.cubeTransform.addShape(this.cubeShape);
	this.cubeTransform.createParam("diffuse","ParamFloat4").value = [red,green,blue,alpha];
	this.cubeTransform.translate(0,cubeL/2+overL,0);
	}

e220.e67.prototype.displayCube = function(){
	this.cubeTransform.parent = this.transformRot;
	}
e220.e67.prototype.clearCube = function(){
	this.cubeTransform.parent = null;
	}

e220.e67.prototype.e265 = function(e228){
	this.visible = true;
			this.transform.parent = e9.transform;
			this.transform.identity();
			this.transformRot.identity();
			
			var deltaXYZ = e228[1].position;
			this.transform.translate(deltaXYZ[0],deltaXYZ[1],deltaXYZ[2]);
			
			if(e228[3][0]){
				this.transformRot.rotateZ(-PI/2);
				}
			else if(e228[3][1]){
				this.transformRot.rotateZ(PI/2);
				}
			else if(e228[3][3]){
				this.transformRot.rotateZ(PI);
				}
			else if(e228[3][4]){
				this.transformRot.rotateX(PI/2);
				}
			else if(e228[3][5]){
				this.transformRot.rotateX(-PI/2);
				}
	}
	
e220.e67.prototype.e264 = function(e228,delta){
	this.transform.identity();
	var deltaXYZ = e228[1].position;
	if(e228[3][0]){		deltaXYZ[0]+=delta;}
	else if(e228[3][1]){deltaXYZ[0]-=delta;}
	else if(e228[3][2]){deltaXYZ[1]+=delta;}
	else if(e228[3][3]){deltaXYZ[1]-=delta;}
	else if(e228[3][4]){deltaXYZ[2]+=delta;}
	else{					deltaXYZ[2]-=delta;}
	this.transform.translate(deltaXYZ[0],deltaXYZ[1],deltaXYZ[2]);
	}
	
e220.e67.prototype.clear = function(){
	this.visible = false;
	this.transform.parent = null;
	}
	
e220.e67.prototype.e255 = function(){
	 this.lightPositionParam.value = e51;
	}
